Skip to content

Commit

Permalink
Catch OSError when calling inspect.getfile (#113671)
Browse files Browse the repository at this point in the history
Summary:
Fixes #111328

X-link: pytorch/pytorch#113671
Approved by: https://github.com/Skylion007, https://github.com/williamwen42

Reviewed By: huydhn

Differential Revision: D51336642

Pulled By: yanboliang

fbshipit-source-id: 7f1aada2a7b3ab9611f35247394510d26889a35f
  • Loading branch information
yanboliang authored and facebook-github-bot committed Nov 15, 2023
1 parent a1c4fdf commit 10b1816
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion userbenchmark/dynamo/dynamobench/_dynamo/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -739,7 +739,7 @@ def torchscript(model, example_inputs, verbose=False):
def getfile(obj):
try:
return inspect.getfile(obj)
except TypeError:
except (TypeError, OSError):
return None


Expand Down

0 comments on commit 10b1816

Please sign in to comment.