[Python-modules-team] Bug#484360: NMU diff for quixote1 1.2-4.1

Ben Hutchings ben at decadent.org.uk
Fri Nov 28 23:47:29 UTC 2008


I went for a version check instead of exception-handling.

This allows destar to run, but I suspect there are other issues as
quixote 1.2 was written for Python 2.3 and is not being updated
upstream.

Ben.

diff -u quixote1-1.2/ptl_compile.py quixote1-1.2/ptl_compile.py
--- quixote1-1.2/ptl_compile.py
+++ quixote1-1.2/ptl_compile.py
@@ -44,6 +44,12 @@
 MARKUP_CLASS = "htmltext"
 MARKUP_MANGLED_CLASS = "_q_htmltext"
 
+# Relative import level argument for "import from" statement
+if sys.version_info >= (2, 5):
+    _from_level = [0]
+else:
+    _from_level = []
+
 class TemplateTransformer(transformer.Transformer):
 
     def __init__(self, *args, **kwargs):
@@ -55,8 +61,9 @@
         # beginning of the module.
         doc = None # self.get_docstring(nodelist, symbol.file_input)
 
-        io_imp = ast.From(IO_MODULE, [(IO_CLASS, None)])
-        markup_imp = ast.From(MARKUP_MODULE, [(MARKUP_CLASS, None)])
+        io_imp = ast.From(IO_MODULE, [(IO_CLASS, None)], *_from_level)
+        markup_imp = ast.From(MARKUP_MODULE, [(MARKUP_CLASS, None)],
+                              *_from_level)
         markup_assign = ast.Assign([ast.AssName(MARKUP_MANGLED_CLASS,
                                                 OP_ASSIGN)],
                                    ast.Name(MARKUP_CLASS))
diff -u quixote1-1.2/debian/changelog quixote1-1.2/debian/changelog
--- quixote1-1.2/debian/changelog
+++ quixote1-1.2/debian/changelog
@@ -1,3 +1,10 @@
+quixote1 (1.2-4.1) unstable; urgency=low
+
+  * Non-maintainer upload
+  * Update ptl_compile for compatibility with Python 2.5 (Closes: #484360)
+
+ -- Ben Hutchings <ben at decadent.org.uk>  Fri, 28 Nov 2008 23:16:58 +0000
+
 quixote1 (1.2-4) unstable; urgency=low
 
   * Updated to the new python policy (Closes: #380926)
--- END ---

-- 
Ben Hutchings
compatible: Gracefully accepts erroneous data from any source
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : http://lists.alioth.debian.org/pipermail/python-modules-team/attachments/20081128/ccde4dee/attachment.pgp 


More information about the Python-modules-team mailing list