File tree Expand file tree Collapse file tree 1 file changed +12
-12
lines changed Expand file tree Collapse file tree 1 file changed +12
-12
lines changed Original file line number Diff line number Diff line change @@ -52,25 +52,25 @@ def visit_ClassDef(self, node):
52
52
self .visit (child )
53
53
54
54
55
- with tempfile .NamedTemporaryFile ("wt" , delete = False ) as f :
56
- for path in mpl .glob ("**/*.py" ):
57
- v = Visitor (path , f )
58
- tree = ast .parse (path .read_text ())
55
+ with tempfile .TemporaryDirectory () as d :
56
+ p = pathlib .Path (d ) / "allowlist.txt"
57
+ with p .open ("wt" ) as f :
58
+ for path in mpl .glob ("**/*.py" ):
59
+ v = Visitor (path , f )
60
+ tree = ast .parse (path .read_text ())
59
61
60
- # Assign parents to tree so they can be backtraced
61
- for node in ast .walk (tree ):
62
- for child in ast .iter_child_nodes (node ):
63
- child .parent = node
62
+ # Assign parents to tree so they can be backtraced
63
+ for node in ast .walk (tree ):
64
+ for child in ast .iter_child_nodes (node ):
65
+ child .parent = node
64
66
65
- v .visit (tree )
66
- f .flush ()
67
- f .close ()
67
+ v .visit (tree )
68
68
proc = subprocess .run (
69
69
[
70
70
"stubtest" ,
71
71
"--mypy-config-file=pyproject.toml" ,
72
72
"--allowlist=ci/mypy-stubtest-allowlist.txt" ,
73
- f"--allowlist={ f . name } " ,
73
+ f"--allowlist={ p } " ,
74
74
"matplotlib" ,
75
75
],
76
76
cwd = root ,
You can’t perform that action at this time.
0 commit comments