]> git.proxmox.com Git - mirror_edk2.git/blobdiff - AppPkg/Applications/Python/Python-2.7.2/Lib/lib2to3/fixes/fix_isinstance.py
edk2: Remove AppPkg, StdLib, StdLibPrivateInternalFiles
[mirror_edk2.git] / AppPkg / Applications / Python / Python-2.7.2 / Lib / lib2to3 / fixes / fix_isinstance.py
diff --git a/AppPkg/Applications/Python/Python-2.7.2/Lib/lib2to3/fixes/fix_isinstance.py b/AppPkg/Applications/Python/Python-2.7.2/Lib/lib2to3/fixes/fix_isinstance.py
deleted file mode 100644 (file)
index 0c2363e..0000000
+++ /dev/null
@@ -1,52 +0,0 @@
-# Copyright 2008 Armin Ronacher.\r
-# Licensed to PSF under a Contributor Agreement.\r
-\r
-"""Fixer that cleans up a tuple argument to isinstance after the tokens\r
-in it were fixed.  This is mainly used to remove double occurrences of\r
-tokens as a leftover of the long -> int / unicode -> str conversion.\r
-\r
-eg.  isinstance(x, (int, long)) -> isinstance(x, (int, int))\r
-       -> isinstance(x, int)\r
-"""\r
-\r
-from .. import fixer_base\r
-from ..fixer_util import token\r
-\r
-\r
-class FixIsinstance(fixer_base.BaseFix):\r
-    BM_compatible = True\r
-    PATTERN = """\r
-    power<\r
-        'isinstance'\r
-        trailer< '(' arglist< any ',' atom< '('\r
-            args=testlist_gexp< any+ >\r
-        ')' > > ')' >\r
-    >\r
-    """\r
-\r
-    run_order = 6\r
-\r
-    def transform(self, node, results):\r
-        names_inserted = set()\r
-        testlist = results["args"]\r
-        args = testlist.children\r
-        new_args = []\r
-        iterator = enumerate(args)\r
-        for idx, arg in iterator:\r
-            if arg.type == token.NAME and arg.value in names_inserted:\r
-                if idx < len(args) - 1 and args[idx + 1].type == token.COMMA:\r
-                    iterator.next()\r
-                    continue\r
-            else:\r
-                new_args.append(arg)\r
-                if arg.type == token.NAME:\r
-                    names_inserted.add(arg.value)\r
-        if new_args and new_args[-1].type == token.COMMA:\r
-            del new_args[-1]\r
-        if len(new_args) == 1:\r
-            atom = testlist.parent\r
-            new_args[0].prefix = atom.prefix\r
-            atom.replace(new_args[0])\r
-        else:\r
-            args[:] = new_args\r
-            node.changed()\r