From: Luke Diamand Date: Fri, 8 Jun 2018 20:32:47 +0000 (+0100) Subject: git-p4: narrow the scope of exceptions caught when parsing an int X-Git-Tag: v2.18.0~21^2~1 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/8fa0abf830ef3c8e97846cef0986589b49bcfe6f?hp=--cc git-p4: narrow the scope of exceptions caught when parsing an int The current code traps all exceptions around some code which parses an integer, and then talks to Perforce. That can result in errors from Perforce being ignored. Change the code to only catch the integer conversion exceptions. Signed-off-by: Luke Diamand Signed-off-by: Junio C Hamano --- 8fa0abf830ef3c8e97846cef0986589b49bcfe6f diff --git a/git-p4.py b/git-p4.py index 90377263fe..37265fc31d 100755 --- a/git-p4.py +++ b/git-p4.py @@ -948,7 +948,7 @@ def p4ChangesForPaths(depotPaths, changeRange, requestedBlockSize): try: (changeStart, changeEnd) = p4ParseNumericChangeRange(parts) block_size = chooseBlockSize(requestedBlockSize) - except: + except ValueError: changeStart = parts[0][1:] changeEnd = parts[1] if requestedBlockSize: