We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a59c268 commit 61661f1Copy full SHA for 61661f1
tools/stubtest.py
@@ -52,7 +52,7 @@ def visit_ClassDef(self, node):
52
self.visit(child)
53
54
55
-with tempfile.NamedTemporaryFile("wt") as f:
+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())
@@ -64,6 +64,7 @@ def visit_ClassDef(self, node):
64
65
v.visit(tree)
66
f.flush()
67
+ f.close()
68
proc = subprocess.run(
69
[
70
"stubtest",
@@ -75,5 +76,9 @@ def visit_ClassDef(self, node):
75
76
cwd=root,
77
env=os.environ | {"MPLBACKEND": "agg"},
78
)
79
+ try:
80
+ os.unlink(f.name)
81
+ except OSError:
82
+ pass
83
84
sys.exit(proc.returncode)
0 commit comments