diff options
author | shadchin <shadchin@yandex-team.ru> | 2022-02-10 16:44:30 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:44:30 +0300 |
commit | 2598ef1d0aee359b4b6d5fdd1758916d5907d04f (patch) | |
tree | 012bb94d777798f1f56ac1cec429509766d05181 /contrib/tools/python3/src/Lib/lib2to3/fixes | |
parent | 6751af0b0c1b952fede40b19b71da8025b5d8bcf (diff) | |
download | ydb-2598ef1d0aee359b4b6d5fdd1758916d5907d04f.tar.gz |
Restoring authorship annotation for <shadchin@yandex-team.ru>. Commit 1 of 2.
Diffstat (limited to 'contrib/tools/python3/src/Lib/lib2to3/fixes')
7 files changed, 14 insertions, 14 deletions
diff --git a/contrib/tools/python3/src/Lib/lib2to3/fixes/fix_apply.py b/contrib/tools/python3/src/Lib/lib2to3/fixes/fix_apply.py index 6408582c42..a3db0f7e45 100644 --- a/contrib/tools/python3/src/Lib/lib2to3/fixes/fix_apply.py +++ b/contrib/tools/python3/src/Lib/lib2to3/fixes/fix_apply.py @@ -38,7 +38,7 @@ class FixApply(fixer_base.BaseFix): # PATTERN above but I don't know how to do it so... if args: if (args.type == self.syms.argument and - args.children[0].value in {'**', '*'}): + args.children[0].value in {'**', '*'}): return # Make no change. if kwds and (kwds.type == self.syms.argument and kwds.children[0].value == '**'): diff --git a/contrib/tools/python3/src/Lib/lib2to3/fixes/fix_filter.py b/contrib/tools/python3/src/Lib/lib2to3/fixes/fix_filter.py index 38e9078f11..df43ead490 100644 --- a/contrib/tools/python3/src/Lib/lib2to3/fixes/fix_filter.py +++ b/contrib/tools/python3/src/Lib/lib2to3/fixes/fix_filter.py @@ -17,7 +17,7 @@ Python 2.6 figure it out. from .. import fixer_base from ..pytree import Node from ..pygram import python_symbols as syms -from ..fixer_util import Name, ArgList, ListComp, in_special_context, parenthesize +from ..fixer_util import Name, ArgList, ListComp, in_special_context, parenthesize class FixFilter(fixer_base.ConditionalFix): @@ -65,14 +65,14 @@ class FixFilter(fixer_base.ConditionalFix): trailers.append(t.clone()) if "filter_lambda" in results: - xp = results.get("xp").clone() - if xp.type == syms.test: - xp.prefix = "" - xp = parenthesize(xp) - + xp = results.get("xp").clone() + if xp.type == syms.test: + xp.prefix = "" + xp = parenthesize(xp) + new = ListComp(results.get("fp").clone(), results.get("fp").clone(), - results.get("it").clone(), xp) + results.get("it").clone(), xp) new = Node(syms.power, [new] + trailers, prefix="") elif "none" in results: diff --git a/contrib/tools/python3/src/Lib/lib2to3/fixes/fix_intern.py b/contrib/tools/python3/src/Lib/lib2to3/fixes/fix_intern.py index d752843092..2e6a78b911 100644 --- a/contrib/tools/python3/src/Lib/lib2to3/fixes/fix_intern.py +++ b/contrib/tools/python3/src/Lib/lib2to3/fixes/fix_intern.py @@ -31,7 +31,7 @@ class FixIntern(fixer_base.BaseFix): obj = results['obj'] if obj: if (obj.type == self.syms.argument and - obj.children[0].value in {'**', '*'}): + obj.children[0].value in {'**', '*'}): return # Make no change. names = ('sys', 'intern') new = ImportAndCall(node, results, names) diff --git a/contrib/tools/python3/src/Lib/lib2to3/fixes/fix_metaclass.py b/contrib/tools/python3/src/Lib/lib2to3/fixes/fix_metaclass.py index fe547b2228..d2253ac79d 100644 --- a/contrib/tools/python3/src/Lib/lib2to3/fixes/fix_metaclass.py +++ b/contrib/tools/python3/src/Lib/lib2to3/fixes/fix_metaclass.py @@ -1,6 +1,6 @@ """Fixer for __metaclass__ = X -> (metaclass=X) methods. - The various forms of classef (inherits nothing, inherits once, inherits + The various forms of classef (inherits nothing, inherits once, inherits many) don't parse the same in the CST so we look at ALL classes for a __metaclass__ and if we find one normalize the inherits to all be an arglist. @@ -51,7 +51,7 @@ def fixup_parse_tree(cls_node): # already in the preferred format, do nothing return - # !%@#! one-liners have no suite node, we have to fake one up + # !%@#! one-liners have no suite node, we have to fake one up for i, node in enumerate(cls_node.children): if node.type == token.COLON: break diff --git a/contrib/tools/python3/src/Lib/lib2to3/fixes/fix_paren.py b/contrib/tools/python3/src/Lib/lib2to3/fixes/fix_paren.py index df3da5f523..be5129e67d 100644 --- a/contrib/tools/python3/src/Lib/lib2to3/fixes/fix_paren.py +++ b/contrib/tools/python3/src/Lib/lib2to3/fixes/fix_paren.py @@ -1,4 +1,4 @@ -"""Fixer that adds parentheses where they are required +"""Fixer that adds parentheses where they are required This converts ``[x for x in 1, 2]`` to ``[x for x in (1, 2)]``.""" diff --git a/contrib/tools/python3/src/Lib/lib2to3/fixes/fix_reload.py b/contrib/tools/python3/src/Lib/lib2to3/fixes/fix_reload.py index b30841131c..c1649aedcc 100644 --- a/contrib/tools/python3/src/Lib/lib2to3/fixes/fix_reload.py +++ b/contrib/tools/python3/src/Lib/lib2to3/fixes/fix_reload.py @@ -28,7 +28,7 @@ class FixReload(fixer_base.BaseFix): obj = results['obj'] if obj: if (obj.type == self.syms.argument and - obj.children[0].value in {'**', '*'}): + obj.children[0].value in {'**', '*'}): return # Make no change. names = ('importlib', 'reload') new = ImportAndCall(node, results, names) diff --git a/contrib/tools/python3/src/Lib/lib2to3/fixes/fix_urllib.py b/contrib/tools/python3/src/Lib/lib2to3/fixes/fix_urllib.py index ab892bc524..1c754df047 100644 --- a/contrib/tools/python3/src/Lib/lib2to3/fixes/fix_urllib.py +++ b/contrib/tools/python3/src/Lib/lib2to3/fixes/fix_urllib.py @@ -13,7 +13,7 @@ MAPPING = {"urllib": [ ("urllib.request", ["URLopener", "FancyURLopener", "urlretrieve", "_urlopener", "urlopen", "urlcleanup", - "pathname2url", "url2pathname", "getproxies"]), + "pathname2url", "url2pathname", "getproxies"]), ("urllib.parse", ["quote", "quote_plus", "unquote", "unquote_plus", "urlencode", "splitattr", "splithost", "splitnport", |