Skip to content

Commit

Permalink
Don't except on load_class import
Browse files Browse the repository at this point in the history
  • Loading branch information
lukemartinlogan committed Oct 2, 2023
1 parent 6fbba07 commit 30b8a54
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion jarvis_util/util/import_mod.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,10 @@ def load_class(import_str, path, class_name):
"""
if len(path):
sys.path.insert(0, path)
module = __import__(import_str, fromlist=[class_name])
try:
module = __import__(import_str, fromlist=[class_name])
except:
return None
if len(path):
sys.path.pop(0)
return getattr(module, class_name)

0 comments on commit 30b8a54

Please sign in to comment.