Skip to content

Commit 88895ab

Browse files
authored
Merge pull request #169 from alliedmodders/psy/file-var
fix: Populate __file__ var when evaluating scripts
2 parents 91a7ec7 + 9a0b25a commit 88895ab

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

ambuild2/frontend/v2_2/context_manager.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,7 @@ def execContext(self, context):
142142

143143
# Copy vars so changes don't get inherited.
144144
scriptGlobals = copy.copy(context.vars_)
145+
scriptGlobals['__file__'] = context.script_
145146

146147
self.pushContext(context)
147148
try:

0 commit comments

Comments
 (0)