Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix 5701: avoid dev_tools/modules.py print_version failing #5705

Merged
merged 4 commits into from
Jul 12, 2022
Merged
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions dev_tools/modules.py
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,7 @@ def _parse_module(folder: Path) -> Dict[str, Any]:

orig_setup = setuptools.setup
cwd = os.getcwd()
sys.path.insert(0, cwd)

def setup(**kwargs):
setup_args.update(kwargs)
Expand All @@ -199,6 +200,7 @@ def setup(**kwargs):
raise
finally:
setuptools.setup = orig_setup
sys.path.remove(cwd)
os.chdir(cwd)


Expand Down