~ubuntu-branches/ubuntu/maverick/python3.1/maverick

« back to all changes in this revision

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

  • Committer: Bazaar Package Importer
  • Author(s): Matthias Klose
  • Date: 2009-03-23 00:01:27 UTC
  • Revision ID: james.westby@ubuntu.com-20090323000127-5fstfxju4ufrhthq
Tags: upstream-3.1~a1+20090322
ImportĀ upstreamĀ versionĀ 3.1~a1+20090322

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# Copyright 2006 Google, Inc. All Rights Reserved.
 
2
# Licensed to PSF under a Contributor Agreement.
 
3
 
 
4
"""Fixer that turns 'long' into 'int' everywhere.
 
5
"""
 
6
 
 
7
# Local imports
 
8
from .. import fixer_base
 
9
from ..fixer_util import Name, Number, is_probably_builtin
 
10
 
 
11
 
 
12
class FixLong(fixer_base.BaseFix):
 
13
 
 
14
    PATTERN = "'long'"
 
15
 
 
16
    static_int = Name("int")
 
17
 
 
18
    def transform(self, node, results):
 
19
        if is_probably_builtin(node):
 
20
            new = self.static_int.clone()
 
21
            new.set_prefix(node.get_prefix())
 
22
            return new