Skip to content

Commit 4f2c686

Browse files
fixups
1 parent 6fc2901 commit 4f2c686

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

Lib/urllib/parse.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,9 +132,9 @@ def _coerce_args(*args):
132132
else:
133133
if isinstance(arg, str) != str_input:
134134
raise TypeError("Cannot mix str and non-str arguments")
135-
if str_input is False and arg is not None and not hasattr(arg, "decode"):
135+
if arg is not None and str_input is False and not hasattr(arg, "decode"):
136136
raise TypeError(f"Expected a string, bytes, or None: got {type(arg)}")
137-
elif arg is not None and arg != "" and arg != b"":
137+
elif arg is not None and not isinstance(arg, str) and not hasattr(arg, "decode"):
138138
warnings.warn(
139139
f"Providing false values other than empty strings, bytes, or"
140140
f"None to urllib.parse is deprecated: got {type(arg)}",

0 commit comments

Comments
 (0)