File: fix_long.py

package info (click to toggle)
python3-stdlib-extensions 3.9.2-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 26,768 kB
  • sloc: python: 106,061; ansic: 19,492; sh: 198; makefile: 154
file content (19 lines) | stat: -rw-r--r-- 476 bytes parent folder | download | duplicates (32)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# 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()