1 diff --git a/piep/main.py b/piep/main.py
2 index f3b1b58..4b18cfc 100755
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')
12 for eval_str in opts.evals:
14 @@ -319,6 +319,7 @@ def compile_pipe_exprs(exprs):
15 transform_def = ast.FunctionDef(
19 args=[arg('p'), arg('i')],
22 @@ -376,7 +377,7 @@ def compile_pipe_exprs(exprs):
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):
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']),
43 def test_import_shorthand(self):
45 - run('--import=cgi', 'cgi.escape(p)', ['a&b']),
46 + run('--import=html', 'html.escape(p)', ['a&b']),
49 def test_globals(self):