Skip to content

Commit 6b28398

Browse files
authored
Update importutil.py (#436)
Signed-off-by: Filip Mulier <[email protected]>
1 parent f83e7c1 commit 6b28398

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

monai/deploy/utils/importutil.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ def get_class_file_path(cls: Type) -> Path:
114114

115115
try:
116116
return Path(inspect.getfile(cls))
117-
except TypeError:
117+
except (TypeError, OSError):
118118
# If in IPython shell, use inspect.stack() to get the caller's file path
119119
stack = inspect.stack()
120120
for frame in stack:

0 commit comments

Comments
 (0)