Skip to content

Commit 0bdf033

Browse files
committed
fixes
1 parent 0c17a14 commit 0bdf033

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

upath/core.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -119,16 +119,17 @@ def __new__(cls, *args, **kwargs) -> Union["UPath", pathlib.Path]:
119119
val = kwargs.get(key)
120120
if val:
121121
parsed_url = parsed_url._replace(**{key: val})
122-
# treat as local filesystem, return PosixPath or WindowsPath
123-
impls = list(registry) + list(known_implementations.keys())
124-
if parsed_url.scheme and parsed_url.scheme in impls:
122+
123+
fsspec_impls = list(registry) + list(known_implementations.keys())
124+
if parsed_url.scheme and parsed_url.scheme in fsspec_impls:
125125
import upath.registry
126126

127127
cls = upath.registry._registry[parsed_url.scheme]
128128
kwargs["_url"] = parsed_url
129129
args_list.insert(0, parsed_url.path)
130130
args = tuple(args_list)
131131
return cls._from_parts(args, **kwargs)
132+
# treat as local filesystem, return PosixPath or WindowsPath
132133
return pathlib.Path(*args, **kwargs)
133134

134135
def __getattr__(self, item):

0 commit comments

Comments
 (0)