1
0
Fork 0
mirror of https://github.com/git/git.git synced 2024-05-04 06:36:35 +02:00

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>
This commit is contained in:
Luke Diamand 2018-06-08 21:32:47 +01:00 committed by Junio C Hamano
parent 55bb3e3611
commit 8fa0abf830

View File

@ -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: