Skip to content

Commit 8fa0abf

Browse files
luked99gitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 55bb3e3 commit 8fa0abf

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

git-p4.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -948,7 +948,7 @@ def p4ChangesForPaths(depotPaths, changeRange, requestedBlockSize):
948948
try:
949949
(changeStart, changeEnd) = p4ParseNumericChangeRange(parts)
950950
block_size = chooseBlockSize(requestedBlockSize)
951-
except:
951+
except ValueError:
952952
changeStart = parts[0][1:]
953953
changeEnd = parts[1]
954954
if requestedBlockSize:

0 commit comments

Comments
 (0)