summaryrefslogtreecommitdiffstats
path: root/abs/core/python_modules/pygobject2/python3-fix-maketrans.patch
diff options
context:
space:
mode:
authorJames Meyer <james.meyer@operamail.com>2012-08-07 18:23:48 (GMT)
committerJames Meyer <james.meyer@operamail.com>2012-08-07 18:23:48 (GMT)
commit65be01bf377eb5aaf0164940661b6a88735661c6 (patch)
tree9e879ed78faa25f5480bf369df50636d680373d4 /abs/core/python_modules/pygobject2/python3-fix-maketrans.patch
parentebeaee292a5a8e7dc402b0d21840cda1cc3d04ac (diff)
downloadlinhes_pkgbuild-65be01bf377eb5aaf0164940661b6a88735661c6.zip
linhes_pkgbuild-65be01bf377eb5aaf0164940661b6a88735661c6.tar.gz
linhes_pkgbuild-65be01bf377eb5aaf0164940661b6a88735661c6.tar.bz2
python_modules: updated a bunch
Diffstat (limited to 'abs/core/python_modules/pygobject2/python3-fix-maketrans.patch')
-rw-r--r--abs/core/python_modules/pygobject2/python3-fix-maketrans.patch36
1 files changed, 36 insertions, 0 deletions
diff --git a/abs/core/python_modules/pygobject2/python3-fix-maketrans.patch b/abs/core/python_modules/pygobject2/python3-fix-maketrans.patch
new file mode 100644
index 0000000..f5bc0e7
--- /dev/null
+++ b/abs/core/python_modules/pygobject2/python3-fix-maketrans.patch
@@ -0,0 +1,36 @@
+From 667bec76ccbc85cc1d54a0e68977dbda241c028c Mon Sep 17 00:00:00 2001
+From: Martin Pitt <martin.pitt@ubuntu.com>
+Date: Wed, 13 Jul 2011 06:42:22 +0000
+Subject: [python3] Fix maketrans import
+
+Python3 moved the maketrans() function from the string module to a str method.
+This unbreaks gi/module.py for Python 3 again.
+---
+diff --git a/gi/module.py b/gi/module.py
+index 70df76c..d56bdaf 100644
+--- a/gi/module.py
++++ b/gi/module.py
+@@ -24,7 +24,11 @@ from __future__ import absolute_import
+
+ import os
+ import gobject
+-import string
++try:
++ maketrans = ''.maketrans
++except AttributeError:
++ # fallback for Python 2
++ from string import maketrans
+
+ import gi
+ from .overrides import registry
+@@ -124,7 +128,7 @@ class IntrospectionModule(object):
+ # Don't use upper() here to avoid locale specific
+ # identifier conversion (e. g. in Turkish 'i'.upper() == 'i')
+ # see https://bugzilla.gnome.org/show_bug.cgi?id=649165
+- ascii_upper_trans = string.maketrans(
++ ascii_upper_trans = maketrans(
+ 'abcdefgjhijklmnopqrstuvwxyz',
+ 'ABCDEFGJHIJKLMNOPQRSTUVWXYZ')
+ for value_info in info.get_values():
+--
+cgit v0.9