8000 Add __file__ variable to globals in exec() by igorgaming · Pull Request #25225 · microsoft/vscode-python · GitHub
[go: up one dir, main page]

Skip to content

Add __file__ variable to globals in exec() #25225

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all 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: 1 addition & 1 deletion python_files/unittestadapter/django_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ def django_execution_runner(manage_py_path: str, test_ids: List[str], args: List
manage_file = manage_path.open()
with argv_context, suppress_context, manage_file:
manage_code = manage_file.read()
exec(manage_code, {"__name__": "__main__"})
exec(manage_code, {"__name__": "__main__", "__file__": manage_path})
except OSError as e:
raise VSCodeUnittestError("Error running Django, unable to read manage.py") from e
except Exception as e:
Expand Down
Loading
0