Skip to content

Commit abb9e26

Browse files
austinavivpicnixz
andauthored
Update Lib/urllib/parse.py
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
1 parent 349ada9 commit abb9e26

1 file changed

Lines changed: 9 additions & 8 deletions

File tree

‎Lib/urllib/parse.py‎

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -307,14 +307,15 @@ def __deepcopy__(self, memo):
307307

308308
def __getstate__(self):
309309
state = super().__getstate__()
310-
if state is not None:
311-
try:
312-
if state[1]['_keep_empty'] == _MISSING_AS_NONE_DEFAULT:
313-
del state[1]['_keep_empty']
314-
if state == (None, {}):
315-
state = None
316-
except LookupError:
317-
pass
310+
if state is None:
311+
return None
312+
try:
313+
if state[1]['_keep_empty'] == _MISSING_AS_NONE_DEFAULT:
314+
del state[1]['_keep_empty']
315+
if state == (None, {}):
316+
state = None
317+
except LookupError:
318+
pass
318319
return state
319320

320321

0 commit comments

Comments
 (0)