diff options
author | Campbell Barton <ideasman42@gmail.com> | 2012-11-22 09:20:51 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2012-11-22 09:20:51 +0400 |
commit | 796988adc91e79e9fcaf1d667e0b6f520d48b58d (patch) | |
tree | 9f79a7f4ee8e5a503f374bd08cb83ed51b34a6ad /release | |
parent | 9d0334bc74b87fc47e54984e8ede7bea84a5b302 (diff) |
modify the python stub to include __file__ and __name__, also correct odd indent in KX_KetsjiEngine.cpp
Diffstat (limited to 'release')
-rw-r--r-- | release/scripts/templates/script_stub.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/release/scripts/templates/script_stub.py b/release/scripts/templates/script_stub.py index 3b3212892d5..143c7c5104a 100644 --- a/release/scripts/templates/script_stub.py +++ b/release/scripts/templates/script_stub.py @@ -8,4 +8,5 @@ import os filename = "my_script.py" filepath = os.path.join(os.path.dirname(bpy.data.filepath), filename) -exec(compile(open(filepath).read(), filepath, 'exec')) +global_namespace = {"__file__": filepath, "__name__": "__main__"} +exec(compile(open(filepath).read(), filepath, 'exec'), global_namespace) |