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 <luke@diamand.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Luke Diamand committed
Jun 8, 2018 at 21:32 UTC
8fa0abf830ef3c8e97846cef0986589b49bcfe6f
1 file changed
+1
-1
git-p4.py
+1
-1
@@ -948,7 +948,7 @@ def p4ChangesForPaths(depotPaths, changeRange, requestedBlockSize):
948
try:
949
(changeStart, changeEnd) = p4ParseNumericChangeRange(parts)
950
block_size = chooseBlockSize(requestedBlockSize)
951
- except:
951
+ except ValueError:
952
changeStart = parts[0][1:]
953
changeEnd = parts[1]
954
if requestedBlockSize: