upgpkg: wordpress 6.2.1-1
[ArchLinux/community.git] / piep / repos / community-any / piep-python3.8.patch
blobc0e50e28516d3d6dbb24751faf3b4613db13849f
1 diff --git a/piep/main.py b/piep/main.py
2 index f3b1b58..4b18cfc 100755
3 --- a/piep/main.py
4 +++ b/piep/main.py
5 @@ -127,7 +127,7 @@ def init_globals(opts, input_file):
6 sys.path.insert(0, path)
7 for import_mod in opts.imports:
8 import_node = ast.Import(names=[ast.alias(name=import_mod, asname=None)])
9 - code = compile(ast.fix_missing_locations(ast.Module(body=[import_node])), 'import %s' % (import_mod,), 'exec')
10 + code = compile(ast.fix_missing_locations(ast.Module(body=[import_node], type_ignores=[])), 'import %s' % (import_mod,), 'exec')
11 eval(code, globs)
12 for eval_str in opts.evals:
13 try:
14 @@ -319,6 +319,7 @@ def compile_pipe_exprs(exprs):
15 transform_def = ast.FunctionDef(
16 name='_transformer',
17 args=ast.arguments(
18 + posonlyargs=[],
19 args=[arg('p'), arg('i')],
20 vararg=None,
21 kwarg=None,
22 @@ -376,7 +377,7 @@ def compile_pipe_exprs(exprs):
23 body.append(expr)
24 body.extend(post_pipe_check)
26 - mod = ast.Module(body=body)
27 + mod = ast.Module(body=body, type_ignores=[])
28 ast.fix_missing_locations(mod)
30 #raise RuntimeError(ast.dump(mod))
31 diff --git a/test/test_statements.py b/test/test_statements.py
32 index accbd28..1bff5d3 100644
33 --- a/test/test_statements.py
34 +++ b/test/test_statements.py
35 @@ -4,12 +4,12 @@ from test.test_helper import run
36 class TestEval(TestCase):
37 def test_import_assignment(self):
38 self.assertEqual(
39 - run('--eval=from cgi import escape as quote', 'quote(p)', ['a&b']),
40 + run('--eval=from html import escape as quote', 'quote(p)', ['a&b']),
41 ['a&b'])
43 def test_import_shorthand(self):
44 self.assertEqual(
45 - run('--import=cgi', 'cgi.escape(p)', ['a&b']),
46 + run('--import=html', 'html.escape(p)', ['a&b']),
47 ['a&b'])
49 def test_globals(self):