[PyKDE] pyuic4 in latest snapshot does not support python 2.3

James Lamanna jlamanna at gmail.com
Thu Oct 26 00:16:27 BST 2006


pyuic4 does not support python 2.3 because it makes use of the
string.rsplit() function which doesn't exist until 2.4.
This is a problem on OSX where the default python is 2.3.
The patch below fixes the issue.

Thanks.
-- James Lamanna

--- pyuic/uic/Compiler/qobjectcreator-orig.py   2006-10-25
16:05:00.000000000 -0700
+++ pyuic/uic/Compiler/qobjectcreator.py        2006-10-25
16:14:10.000000000 -0700
@@ -19,7 +19,11 @@
 class _ModuleWrapper(object):
     def __init__(self, name, classes):
         if "." in name:
-            self._package, self._module = name.rsplit(".", 1)
+            #self._package, self._module = name.rsplit(".", 1)
+            # Python 2.3 compatibility
+            idx = name.rfind(".")
+            self._package = name[:idx]
+            self._module = name[idx+1:]
         else:
             self._package = None
             self._module = name




More information about the PyQt mailing list