Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 8 additions & 7 deletions flexbe_onboard/src/flexbe_onboard/flexbe_onboard.py
Original file line number Diff line number Diff line change
Expand Up @@ -281,16 +281,17 @@ def _is_switchable(self, be):


def _cleanup_behavior(self, behavior_checksum):
del(sys.modules["tmp_%d" % behavior_checksum])
file_path = os.path.join(self._tmp_folder, 'tmp_%d.pyc' % behavior_checksum)
module_name = "tmp_%d" % behavior_checksum
try:
module = sys.modules[module_name]
file_path = module.__file__
del sys.modules[module_name]
except KeyError:
return
if os.path.exists(file_path):
os.remove(file_path)
except OSError:
pass
try:
if os.path.exists(file_path + 'c'):
os.remove(file_path + 'c')
except OSError:
pass


def _cleanup_tempdir(self):
Expand Down