rpms/flumotion/F-11 python2.6.patch, NONE, 1.1 flumotion.spec, 1.18, 1.19

Thomas Vander Stichele thomasvs at fedoraproject.org
Tue Jun 16 12:19:38 UTC 2009


Author: thomasvs

Update of /cvs/extras/rpms/flumotion/F-11
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv23048

Modified Files:
	flumotion.spec 
Added Files:
	python2.6.patch 
Log Message:
fix for python2.6


python2.6.patch:

--- NEW FILE python2.6.patch ---
Index: flumotion/common/package.py
===================================================================
--- flumotion/common/package.py	(revision 7955)
+++ flumotion/common/package.py	(working copy)
@@ -31,6 +31,29 @@
 from flumotion.common import log, common
 from twisted.python import rebuild, reflect
 
+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
@@ -81,7 +104,12 @@
         self.debug('installing custom importer')
         self._hooks = PackageHooks()
         self._hooks.packager = self
-        self._importer = ihooks.ModuleImporter()
+        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.set_hooks(self._hooks)
         self._importer.install()
 


Index: flumotion.spec
===================================================================
RCS file: /cvs/extras/rpms/flumotion/F-11/flumotion.spec,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -p -r1.18 -r1.19
--- flumotion.spec	24 Feb 2009 17:39:07 -0000	1.18
+++ flumotion.spec	16 Jun 2009 12:19:07 -0000	1.19
@@ -6,13 +6,14 @@
 
 Name:           flumotion
 Version:        0.4.2
-Release:        8%{?dist}
+Release:        9%{?dist}
 Summary:        Streaming Server based on GStreamer and Twisted
 
 Group:          Applications/Internet
 License:	GPLv2
 URL:            http://www.flumotion.net/
 Source:         http://www.flumotion.net/src/flumotion/%{name}-%{version}.tar.bz2
+Patch0:         python2.6.patch
 BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root
 
 Requires:	python >= 2.3
@@ -69,6 +70,7 @@ it.
 
 %prep
 %setup -q
+%patch0
 
 %build
 %configure
@@ -251,6 +253,11 @@ fi
 %{_sysconfdir}/rc.d/init.d/flumotion
 
 %changelog
+* Tue Jun 16 2009 Thomas Vander Stichele <thomas at apestaart dot org>
+- 0.4.2-9
+- Include patch for python2.6 from
+  https://code.fluendo.com/flumotion/trac/changeset/7960
+
 * Tue Feb 24 2009 Fedora Release Engineering <rel-eng at lists.fedoraproject.org> - 0.4.2-8
 - Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild
 




More information about the fedora-extras-commits mailing list