File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -13,6 +13,14 @@ def _reset_tzpath(to=None, stacklevel=4):
1313 + f"not { type (tzpaths )} : { tzpaths !r} "
1414 )
1515
16+ tzpaths = [os .fspath (p ) for p in tzpaths ]
17+ nonstr_paths = [p for p in tzpaths if not isinstance (p , str )]
18+ if nonstr_paths :
19+ raise TypeError (
20+ "All elements of a tzpath sequence must be strings or "
21+ "os.PathLike objects which convert to strings."
22+ )
23+
1624 if not all (map (os .path .isabs , tzpaths )):
1725 raise ValueError (_get_invalid_paths_message (tzpaths ))
1826 base_tzpath = tzpaths
@@ -57,7 +65,7 @@ def _parse_python_tzpath(env_var, stacklevel):
5765
5866
5967def _get_invalid_paths_message (tzpaths ):
60- invalid_paths = (os . fspath ( path ) for path in tzpaths if not os .path .isabs (path ))
68+ invalid_paths = (path for path in tzpaths if not os .path .isabs (path ))
6169
6270 prefix = "\n "
6371 indented_str = prefix + prefix .join (invalid_paths )
You can’t perform that action at this time.
0 commit comments