Skip to content

Commit 206e7b8

Browse files
committed
Simplified conditionals
Signed-off-by: Doug Halley <[email protected]>
1 parent cf27483 commit 206e7b8

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/py-opentimelineio/opentimelineio/url_utils.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,17 +65,17 @@ def filepath_from_url(urlstr):
6565
if PureWindowsPath(parsed_result.netloc).drive:
6666
filepath = Path(parsed_result.netloc + parsed_result.path)
6767

68-
# Check if the specified index is a windows drive, if it is then do nothing
69-
elif PureWindowsPath(filepath.parts[0]).drive:
68+
# Check if the specified index has a specified `drive`, if so then do nothing
69+
elif filepath.drive:
7070
filepath = filepath
7171

7272
# Check if the specified index is a windows drive, then offset the path
7373
elif PureWindowsPath(filepath.parts[1]).drive:
7474
# Remove leading "/" if/when `request.url2pathname` yields "/S:/path/file.ext"
7575
filepath = filepath.relative_to(filepath.root)
7676

77-
# Last resort, if using a "file" schema, then strip the "file:" prefix
78-
elif parsed_result.scheme == 'file':
77+
# Last resort, strip the "file:" prefix
78+
else:
7979
filepath = Path(decoded_url_str.strip('file:'))
8080

8181
# Convert "\" to "/" if needed

0 commit comments

Comments
 (0)