Skip to content

Commit 55a35d2

Browse files
authored
Merge pull request #379 from capocchi/version-5.1
Version 5.1
2 parents 8f7fa5d + 4bdb6e7 commit 55a35d2

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

devsimpy/DEVSKernel/Strategies.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,18 @@
2222
import heapq
2323
import threading
2424
import importlib
25-
import json
2625
import builtins
2726
import re
2827
import os
2928

29+
# Ensure the package root (the 'devsimpy' directory) is on sys.path so imports
30+
# such as 'PluginManager' or 'DEVSKernel.*' are resolvable when running from the repo root.
31+
_pkg_dir = os.path.dirname(__file__)
32+
_pkg_root = os.path.dirname(_pkg_dir)
33+
if _pkg_root not in sys.path:
34+
# insert at front to prefer local package over any installed packages
35+
sys.path.insert(0, _pkg_root)
36+
3037
from PluginManager import PluginManager #trigger_event
3138
from Utilities import getOutDir
3239
from Patterns.Strategy import SimStrategy
@@ -41,6 +48,7 @@
4148
import importlib
4249
exec("%s = importlib.import_module('DEVSKernel%s.DEVS')"%(pydevs_dir,d))
4350

51+
4452
## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ##
4553
#
4654
# GLOBAL VARIABLES AND FUNCTIONS

0 commit comments

Comments
 (0)