Skip to content

Commit

Permalink
Guard is_file check on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
philippjfr committed May 31, 2023
1 parent cf97774 commit 500cb0f
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion panel/io/resources.py
Original file line number Diff line number Diff line change
Expand Up @@ -440,7 +440,12 @@ def _resolve_resource(cls, resource_type: str, resource: str, cdn: bool = False)
prefixed_dist = dist_path

bundlepath = BUNDLE_DIR / resource_path.replace('/', os.path.sep)
if bundlepath.is_file():
# Windows may trigger OSError: [WinError 123]
try:
is_file = bundlepath.is_file()
except Exception:
is_file = False
if is_file:
return f'{prefixed_dist}bundled/{resource_path}'
elif isurl(resource):
return resource
Expand Down

0 comments on commit 500cb0f

Please sign in to comment.