Skip to content

Commit e479a4e

Browse files
committed
Pass __file__ to sample runner.
1 parent 0f2771c commit e479a4e

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎samples/docs/samplerunner.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
def Run(source_file):
2323
"""Load a source file and run a sample from it."""
2424
source = open(source_file).read()
25-
global_dict = {}
25+
global_dict = {'__file__': source_file}
2626
exec source in global_dict
2727
samples = [global_dict[k] for k in global_dict if k.endswith('Sample')]
2828
lines = source.splitlines()

0 commit comments

Comments
 (0)