Skip to content

Commit a8273e6

Browse files
arbitrary_subfolders: Make things work more cleanly if you run __init__.py as __main__
1 parent ee384da commit a8273e6

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

__init__.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -252,6 +252,7 @@ def populate_registry():
252252

253253

254254
if __name__ == '__main__':
255-
# Ensure code importing labscript_devices gets this module if we're running as
256-
# __main__, rather than a copy.
255+
# If this module is run as __main__, make sure importing submodules still works,
256+
# without double-importing this file:
257+
__path__ = [os.path.dirname(os.path.abspath(__file__))]
257258
sys.modules['labscript_devices'] = sys.modules['__main__']

0 commit comments

Comments
 (0)