diff options
author | Stan Seibert <stan@mtrr.org> | 2011-12-21 11:21:50 -0500 |
---|---|---|
committer | tlatorre <tlatorre@uchicago.edu> | 2021-05-09 08:42:38 -0700 |
commit | 75340bfedff45f70018900a56b68d3ec6ccd30c3 (patch) | |
tree | 3d1d92eb72f045c418353dd4e4b48be9009f9fa2 /bin/chroma-cam | |
parent | 2893305a07789ab880821093f8d719e3eb6c8e31 (diff) | |
download | chroma-75340bfedff45f70018900a56b68d3ec6ccd30c3.tar.gz chroma-75340bfedff45f70018900a56b68d3ec6ccd30c3.tar.bz2 chroma-75340bfedff45f70018900a56b68d3ec6ccd30c3.zip |
Temporarily include the current directory in the module path when loading detector geometries.
Diffstat (limited to 'bin/chroma-cam')
-rwxr-xr-x | bin/chroma-cam | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/bin/chroma-cam b/bin/chroma-cam index 25f0eb3..c75f28f 100755 --- a/bin/chroma-cam +++ b/bin/chroma-cam @@ -32,10 +32,13 @@ if __name__ == '__main__': obj = mesh_from_stl(args[0]) else: module_name, function_name = args[0].rsplit('.', 1) - + orig_sys_path = list(sys.path) try: + sys.path.append('.') module = __import__(module_name, fromlist=[function_name]) + sys.path = orig_sys_path except ImportError: + sys.path = orig_sys_path raise obj = getattr(module, function_name) |