[Python-checkins] distutils2: replaced get_next_sibling() calls by next_sibling (>=2.6.5rc2)

tarek.ziade python-checkins at python.org
Sat May 22 23:28:59 CEST 2010


tarek.ziade pushed 105229c23a6a to distutils2:

http://hg.python.org/distutils2/rev/105229c23a6a
changeset:   155:105229c23a6a
tag:         tip
user:        Tarek Ziade <tarek at ziade.org>
date:        Sat May 22 23:28:50 2010 +0200
summary:     replaced get_next_sibling() calls by next_sibling (>=2.6.5rc2)
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
@@ -31,10 +31,10 @@
         if imp.value == 'setuptools':
             # catching "from setuptools import setup"
             pattern = []
-            next = imp.get_next_sibling()
+            next = imp.next_sibling
             while next is not None:
                 pattern.append(next.value)
-                next = next.get_next_sibling()
+                next = next.next_sibling
             if pattern == ['import', 'setup']:
                 imp.value = 'distutils2.core'
                 imp.changed()
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,15 +41,14 @@
 
     def _fix_name(self, argument, remove_list):
         name = argument.children[0]
-        next = name.get_next_sibling
-        sibling = next()
+        sibling = name.next_sibling
         if sibling is None or sibling.type != token.EQUAL:
             return False
 
         if name.value in _OLD_NAMES:
             name.value = _OLD_NAMES[name.value]
             if name.value in _SEQUENCE_NAMES:
-                right_operand = next().get_next_sibling()
+                right_operand = sibling.next_sibling
                 # replacing string -> list[string]
                 if right_operand.type == token.STRING:
                     # we want this to be a list now

--
Repository URL: http://hg.python.org/distutils2


More information about the Python-checkins mailing list