Staging
v0.5.1
https://github.com/python/cpython
Raw File
Tip revision: d56cd4006a1c5e07b0bf69fad9fc8e2fbf6aa855 authored by Ned Deily on 27 June 2020, 09:14:00 UTC
3.6.11
Tip revision: d56cd40
fix_long.py
# Copyright 2006 Google, Inc. All Rights Reserved.
# Licensed to PSF under a Contributor Agreement.

"""Fixer that turns 'long' into 'int' everywhere.
"""

# Local imports
from lib2to3 import fixer_base
from lib2to3.fixer_util import is_probably_builtin


class FixLong(fixer_base.BaseFix):
    BM_compatible = True
    PATTERN = "'long'"

    def transform(self, node, results):
        if is_probably_builtin(node):
            node.value = "int"
            node.changed()
back to top