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 3380a21 commit de07be5Copy full SHA for de07be5
tests/pgle_test.py
@@ -18,6 +18,7 @@
18
import logging
19
import math
20
import os
21
+import shutil
22
import tempfile
23
24
from absl.testing import absltest
@@ -286,7 +287,11 @@ def f(x):
286
287
# Removing non-pgle profiled module from cache to check that later pgle
288
# profiled version will be used.
289
for non_pgle_file in non_pgle_profiled_files:
- os.remove(os.path.join(cache_dir, non_pgle_file))
290
+ path = os.path.join(cache_dir, non_pgle_file)
291
+ if os.path.isfile(path):
292
+ os.remove(path)
293
+ elif os.path.isdir(path):
294
+ shutil.rmtree(path)
295
296
api.clear_caches()
297
pjit._pgle_profiler_dict.clear()
0 commit comments