Skip to content

Commit cf0b6de

Browse files
committed
remove, not hide, extensions
1 parent d5b48c7 commit cf0b6de

File tree

2 files changed

+8
-19
lines changed

2 files changed

+8
-19
lines changed

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ help: ## Show this help.
1616
@awk -F ':.*##' '/^[^: ]+:.*##/{printf " \033[1m%-20s\033[m %s\n",$$1,$$2} /^##@/{printf "\n%s\n",substr($$0,5)}' $(MAKEFILE_LIST)
1717

1818
_clean_platform:
19-
@rm -f *.so */*.so */*.so.hidden
20-
@rm -f *.pyd */*.pyd */*.pyd.hidden
19+
@rm -f *.so */*.so
20+
@rm -f *.pyd */*.pyd
2121
@rm -rf __pycache__ */__pycache__ */*/__pycache__ */*/*/__pycache__ */*/*/*/__pycache__ */*/*/*/*/__pycache__
2222
@rm -f *.pyc */*.pyc */*/*.pyc */*/*/*.pyc */*/*/*/*.pyc */*/*/*/*/*.pyc
2323
@rm -f *.pyo */*.pyo */*/*.pyo */*/*/*.pyo */*/*/*/*.pyo */*/*/*/*/*.pyo

igor.py

Lines changed: 6 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,8 @@ def do_show_env():
5252
print(f" {env} = {os.environ[env]!r}")
5353

5454

55-
def hide_extension(core, *args):
56-
"""Hide the compiled C extension, no matter what its name."""
55+
def remove_extension(core, *args):
56+
"""Remove the compiled C extension, no matter what its name."""
5757

5858
if core == "ctrace":
5959
return
@@ -97,11 +97,7 @@ def hide_extension(core, *args):
9797
if VERBOSITY > 1:
9898
print(f"Removing {os.path.abspath(filename)}")
9999
try:
100-
hidden_name = filename + ".hidden"
101-
if os.path.exists(hidden_name):
102-
os.remove(hidden_name)
103-
os.rename(filename, hidden_name)
104-
return hidden_name
100+
os.remove(filename)
105101
except OSError as exc:
106102
if VERBOSITY > 1:
107103
print(f"Couldn't remove {os.path.abspath(filename)}: {exc}")
@@ -164,16 +160,11 @@ def make_env_id(core):
164160

165161
def run_tests(core, *runner_args):
166162
"""The actual running of tests."""
167-
hidden = hide_extension(core)
163+
remove_extension(core)
168164
if "COVERAGE_TESTING" not in os.environ:
169165
os.environ["COVERAGE_TESTING"] = "True"
170166
print_banner(label_for_core(core))
171-
172-
try:
173-
return pytest.main(list(runner_args))
174-
finally:
175-
if hidden:
176-
os.remove(hidden)
167+
return pytest.main(list(runner_args))
177168

178169

179170
def run_tests_with_coverage(core, *runner_args):
@@ -222,7 +213,7 @@ def run_tests_with_coverage(core, *runner_args):
222213
if getattr(mod, "__file__", "??").startswith(covdir):
223214
covmods[name] = mod
224215
del sys.modules[name]
225-
hidden = hide_extension(core)
216+
remove_extension(core)
226217

227218
# Remove the reference to metacov.ini.
228219
del os.environ["COVERAGE_PROCESS_START"]
@@ -237,8 +228,6 @@ def run_tests_with_coverage(core, *runner_args):
237228
finally:
238229
cov.stop()
239230
os.remove(pth_path)
240-
if hidden:
241-
os.remove(hidden)
242231

243232
cov.save()
244233
return status

0 commit comments

Comments
 (0)