[Python-modules-commits] r34208 - in packages/genshi/trunk/debian (4 files)
barry at users.alioth.debian.org
barry at users.alioth.debian.org
Tue Sep 8 20:18:42 UTC 2015
Date: Tuesday, September 8, 2015 @ 20:18:41
Author: barry
Revision: 34208
* debian/patches/issue602.patch: Upstream patch for Python 3.5
compatibility.
* debian/control: Bump Standards-Version with no other changes needed.
Added:
packages/genshi/trunk/debian/patches/issue602.patch
Modified:
packages/genshi/trunk/debian/changelog
packages/genshi/trunk/debian/control
packages/genshi/trunk/debian/patches/series
Modified: packages/genshi/trunk/debian/changelog
===================================================================
--- packages/genshi/trunk/debian/changelog 2015-09-08 19:57:12 UTC (rev 34207)
+++ packages/genshi/trunk/debian/changelog 2015-09-08 20:18:41 UTC (rev 34208)
@@ -1,3 +1,11 @@
+genshi (0.7-4) UNRELEASED; urgency=medium
+
+ * debian/patches/issue602.patch: Upstream patch for Python 3.5
+ compatibility.
+ * debian/control: Bump Standards-Version with no other changes needed.
+
+ -- Barry Warsaw <barry at debian.org> Tue, 01 Sep 2015 16:07:47 -0400
+
genshi (0.7-3) unstable; urgency=medium
[ Barry Warsaw ]
Modified: packages/genshi/trunk/debian/control
===================================================================
--- packages/genshi/trunk/debian/control 2015-09-08 19:57:12 UTC (rev 34207)
+++ packages/genshi/trunk/debian/control 2015-09-08 20:18:41 UTC (rev 34208)
@@ -9,7 +9,7 @@
python-setuptools (>= 0.6b3),
python3-all-dev,
python3-setuptools
-Standards-Version: 3.9.5
+Standards-Version: 3.9.6
X-Python-Version: >= 2.7
X-Python3-Version: >= 3.2
Homepage: http://genshi.edgewall.org/
Added: packages/genshi/trunk/debian/patches/issue602.patch
===================================================================
--- packages/genshi/trunk/debian/patches/issue602.patch (rev 0)
+++ packages/genshi/trunk/debian/patches/issue602.patch 2015-09-08 20:18:41 UTC (rev 34208)
@@ -0,0 +1,94 @@
+Description: Fix Python 3.5 compatibility issues.
+Origin: http://genshi.edgewall.org/attachment/ticket/602/t602.diff
+Bug: http://genshi.edgewall.org/ticket/602
+Forwarded: not-needed
+
+--- a/genshi/filters/i18n.py
++++ b/genshi/filters/i18n.py
+@@ -1187,8 +1187,10 @@
+ elif arg:
+ strings.append(None)
+ [_add(arg) for arg in node.args]
+- _add(node.starargs)
+- _add(node.kwargs)
++ if hasattr(node, 'starargs'):
++ _add(node.starargs)
++ if hasattr(node, 'kwargs'):
++ _add(node.kwargs)
+ if len(strings) == 1:
+ strings = strings[0]
+ else:
+--- a/genshi/template/astutil.py
++++ b/genshi/template/astutil.py
+@@ -135,6 +135,10 @@
+ def visit_arg(self, node):
+ self._write(node.arg)
+
++ def visit_Starred(self, node):
++ self._write('*')
++ self.visit(node.value)
++
+ # FunctionDef(identifier name, arguments args,
+ # stmt* body, expr* decorator_list)
+ def visit_FunctionDef(self, node):
+@@ -648,9 +652,13 @@
+ if not first:
+ self._write(', ')
+ first = False
+- # keyword = (identifier arg, expr value)
+- self._write(keyword.arg)
+- self._write('=')
++ if not keyword.arg:
++ # Python 3.5+ star-star args
++ self._write('**')
++ else:
++ # keyword = (identifier arg, expr value)
++ self._write(keyword.arg)
++ self._write('=')
+ self.visit(keyword.value)
+ if getattr(node, 'starargs', None):
+ if not first:
+--- a/genshi/template/directives.py
++++ b/genshi/template/directives.py
+@@ -266,13 +266,21 @@
+ if isinstance(ast, _ast.Call):
+ self.name = ast.func.id
+ for arg in ast.args:
+- # only names
+- self.args.append(arg.id)
++ if hasattr(_ast, 'Starred') and isinstance(arg, _ast.Starred):
++ # Python 3.5+
++ self.star_args = arg.value.id
++ else:
++ # only names
++ self.args.append(arg.id)
+ for kwd in ast.keywords:
+- self.args.append(kwd.arg)
+- exp = Expression(kwd.value, template.filepath,
+- lineno, lookup=template.lookup)
+- self.defaults[kwd.arg] = exp
++ if kwd.arg is None:
++ # Python 3.5+
++ self.dstar_args = kwd.value.id
++ else:
++ self.args.append(kwd.arg)
++ exp = Expression(kwd.value, template.filepath,
++ lineno, lookup=template.lookup)
++ self.defaults[kwd.arg] = exp
+ if getattr(ast, 'starargs', None):
+ self.star_args = ast.starargs.id
+ if getattr(ast, 'kwargs', None):
+--- a/genshi/template/eval.py
++++ b/genshi/template/eval.py
+@@ -593,6 +593,11 @@
+ finally:
+ self.locals.pop()
+
++ # Only used in Python 3.5+
++ def visit_Starred(self, node):
++ node.value = self.visit(node.value)
++ return node
++
+ def visit_Name(self, node):
+ # If the name refers to a local inside a lambda, list comprehension, or
+ # generator expression, leave it alone
Modified: packages/genshi/trunk/debian/patches/series
===================================================================
--- packages/genshi/trunk/debian/patches/series 2015-09-08 19:57:12 UTC (rev 34207)
+++ packages/genshi/trunk/debian/patches/series 2015-09-08 20:18:41 UTC (rev 34208)
@@ -1,2 +1,3 @@
+issue602.patch
fix_tests_failure_with_python27.patch
issue582.patch
More information about the Python-modules-commits
mailing list