summarylogtreecommitdiffstats
path: root/fix-import.patch
diff options
context:
space:
mode:
authorBalló György2017-01-22 15:44:58 +0100
committerBalló György2017-01-22 15:44:58 +0100
commit0d47b4781dc54f0494919c9726c32a767e088c05 (patch)
tree9634d10f7cddbb108b2761982687e16bde948a77 /fix-import.patch
downloadaur-flumotion.tar.gz
Move package from the [community] repository
Diffstat (limited to 'fix-import.patch')
-rw-r--r--fix-import.patch63
1 files changed, 63 insertions, 0 deletions
diff --git a/fix-import.patch b/fix-import.patch
new file mode 100644
index 000000000000..904ffe6faced
--- /dev/null
+++ b/fix-import.patch
@@ -0,0 +1,63 @@
+From ebd389075f48253a12a71e457445a05f4373fe5e Mon Sep 17 00:00:00 2001
+From: Tim 'mithro' Ansell <mithro@mithis.com>
+Date: Mon, 28 Jul 2014 01:01:59 +0930
+Subject: [PATCH] Removing the _PatchedModuleImporter hook.
+
+The _PatchedModuleImporter didn't pass through the level argument which is
+needed for the future absolute_import to work properly.
+
+```python
+from __future__ import absolute_import
+```
+---
+ flumotion/common/package.py | 30 +-----------------------------
+ 1 file changed, 1 insertion(+), 29 deletions(-)
+
+diff --git a/flumotion/common/package.py b/flumotion/common/package.py
+index 5dbb05c..d41c04a 100644
+--- a/flumotion/common/package.py
++++ b/flumotion/common/package.py
+@@ -31,29 +31,6 @@
+ __version__ = "$Rev$"
+
+
+-class _PatchedModuleImporter(ihooks.ModuleImporter):
+- """
+- I am overriding ihook's ModuleImporter's import_module() method to
+- accept (and ignore) the 'level' keyword argument that appeared in
+- the built-in __import__() function in python2.5.
+-
+- While no built-in modules in python2.5 seem to use that keyword
+- argument, 'encodings' module in python2.6 does and so it breaks if
+- used together with ihooks.
+-
+- I make no attempt to properly support the 'level' argument -
+- ihooks didn't make it into py3k, and the only use in python2.6
+- we've seen so far, in 'encodings', serves as a performance hint
+- and it seems that can be ignored with no difference in behaviour.
+- """
+-
+- def import_module(self, name, globals=None, locals=None, fromlist=None,
+- level=-1):
+- # all we do is drop 'level' as ihooks don't support it, anyway
+- return ihooks.ModuleImporter.import_module(self, name, globals,
+- locals, fromlist)
+-
+-
+ class PackageHooks(ihooks.Hooks):
+ """
+ I am an import Hooks object that makes sure that every package that gets
+@@ -106,12 +83,7 @@ def install(self):
+ self.debug('installing custom importer')
+ self._hooks = PackageHooks()
+ self._hooks.packager = self
+- if sys.version_info < (2, 6):
+- self._importer = ihooks.ModuleImporter()
+- else:
+- self.debug('python2.6 or later detected - using patched'
+- ' ModuleImporter')
+- self._importer = _PatchedModuleImporter()
++ self._importer = ihooks.ModuleImporter()
+ self._importer.set_hooks(self._hooks)
+ self._importer.install()
+