[Python-checkins] distutils2: Fix uncompatibility with lib2to3 pytree.Base.next_sibling() changed in python
tarek.ziade
python-checkins at python.org
Sun May 30 00:05:49 CEST 2010
tarek.ziade pushed 807e6867e133 to distutils2:
http://hg.python.org/distutils2/rev/807e6867e133
changeset: 161:807e6867e133
parent: 159:ddb6eda2abd7
user: Pior Bastida <pior at pbastida.net>
date: Sat May 22 20:03:16 2010 -0400
summary: Fix uncompatibility with lib2to3 pytree.Base.next_sibling() changed in python 2.6.5
files: src/distutils2/converter/fixers/fix_imports.py, src/distutils2/converter/fixers/fix_setup_options.py
diff --git a/src/distutils2/converter/fixers/fix_imports.py b/src/distutils2/converter/fixers/fix_imports.py
--- a/src/distutils2/converter/fixers/fix_imports.py
+++ b/src/distutils2/converter/fixers/fix_imports.py
@@ -20,6 +20,9 @@
if node.type != syms.import_from:
return
+ if not hasattr(imp, "next_sibling"):
+ imp.next_sibling = imp.get_next_sibling
+
while not hasattr(imp, 'value'):
imp = imp.children[0]
diff --git a/src/distutils2/converter/fixers/fix_setup_options.py b/src/distutils2/converter/fixers/fix_setup_options.py
--- a/src/distutils2/converter/fixers/fix_setup_options.py
+++ b/src/distutils2/converter/fixers/fix_setup_options.py
@@ -41,6 +41,10 @@
def _fix_name(self, argument, remove_list):
name = argument.children[0]
+
+ if not hasattr(name, "next_sibling"):
+ name.next_sibling = name.get_next_sibling
+
sibling = name.next_sibling
if sibling is None or sibling.type != token.EQUAL:
return False
--
Repository URL: http://hg.python.org/distutils2
More information about the Python-checkins
mailing list