~ubuntu-branches/ubuntu/lucid/python2.6/lucid

« back to all changes in this revision

Viewing changes to Lib/lib2to3/fixes/fix_itertools.py

  • Committer: Bazaar Package Importer
  • Author(s): Matthias Klose
  • Date: 2010-03-11 13:30:19 UTC
  • mto: (10.1.13 sid)
  • mto: This revision was merged to the branch mainline in revision 44.
  • Revision ID: james.westby@ubuntu.com-20100311133019-sblbooa3uqrkoe70
Tags: upstream-2.6.5~rc2
ImportĀ upstreamĀ versionĀ 2.6.5~rc2

Show diffs side-by-side

added added

removed removed

Lines of Context:
27
27
    def transform(self, node, results):
28
28
        prefix = None
29
29
        func = results['func'][0]
30
 
        if 'it' in results and func.value != 'ifilterfalse':
 
30
        if 'it' in results and func.value != u'ifilterfalse':
31
31
            dot, it = (results['dot'], results['it'])
32
32
            # Remove the 'itertools'
33
 
            prefix = it.get_prefix()
 
33
            prefix = it.prefix
34
34
            it.remove()
35
35
            # Replace the node wich contains ('.', 'function') with the
36
36
            # function (to be consistant with the second part of the pattern)
37
37
            dot.remove()
38
38
            func.parent.replace(func)
39
39
 
40
 
        prefix = prefix or func.get_prefix()
 
40
        prefix = prefix or func.prefix
41
41
        func.replace(Name(func.value[1:], prefix=prefix))