Skip to content

Commit c7fd90a

Browse files
authored
Add __file__ variable to globals in exec() (#25225)
Closes #25056
1 parent 500cec5 commit c7fd90a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

python_files/unittestadapter/django_handler.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ def django_execution_runner(manage_py_path: str, test_ids: List[str], args: List
104104
manage_file = manage_path.open()
105105
with argv_context, suppress_context, manage_file:
106106
manage_code = manage_file.read()
107-
exec(manage_code, {"__name__": "__main__"})
107+
exec(manage_code, {"__name__": "__main__", "__file__": manage_path})
108108
except OSError as e:
109109
raise VSCodeUnittestError("Error running Django, unable to read manage.py") from e
110110
except Exception as e:

0 commit comments

Comments
 (0)