[issue35447] Redundant try-except block in urllib

2018-12-10 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I concur with Martin. The try-except block was added for purpose. -- nosy: +serhiy.storchaka resolution: -> not a bug stage: patch review -> resolved status: open -> closed ___ Python tracker

[issue35447] Redundant try-except block in urllib

2018-12-09 Thread Martin Panter
Martin Panter added the comment: That would not include the custom error message for the first two cases I listed. I suggest closing this. -- ___ Python tracker ___ _

[issue35447] Redundant try-except block in urllib

2018-12-09 Thread Shishmarev Pavel
Shishmarev Pavel added the comment: https://github.com/python/cpython/blob/master/Lib/urllib/parse.py#L875 It's redundant to raise and then catch exception. I mean: if len(query) and not isinstance(query[0], tuple): ty, va, tb = sys.exc_info() raise TypeError("not a valid non-string se

[issue35447] Redundant try-except block in urllib

2018-12-09 Thread Martin Panter
Martin Panter added the comment: Code in question: try: # non-sequence items should not work with len() # non-empty strings will fail this if len(query) and not isinstance(query[0], tuple): raise TypeError # [. . .] except TypeError: ty, va, tb = sys.exc_info()

[issue35447] Redundant try-except block in urllib

2018-12-09 Thread Shishmarev Pavel
Change by Shishmarev Pavel : -- pull_requests: +10288 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https:/

[issue35447] Redundant try-except block in urllib

2018-12-09 Thread Shishmarev Pavel
Change by Shishmarev Pavel : -- keywords: +patch pull_requests: +10287 stage: -> patch review ___ Python tracker ___ ___ Python-bug

[issue35447] Redundant try-except block in urllib

2018-12-09 Thread Shishmarev Pavel
New submission from Shishmarev Pavel : https://github.com/python/cpython/blob/master/Lib/urllib/parse.py#L875 It's redundant to raise and then catch exception. -- components: Library (Lib) messages: 331436 nosy: PashaWNN priority: normal severity: normal status: open title: Redundant tr