Skip to content

Commit 40e7cfd

Browse files
jholgitster
authored andcommitted
git-p4: fix instantiation of CalledProcessError
CalledProcessError is an exception class from the subprocess namespace. When raising this exception, git-p4 would instantiate CalledProcessError objects without properly referencing the subprocess namespace causing the script to fail. Resolves the issue by replacing CalledProcessError with subprocess.CalledProcessError. Signed-off-by: Joel Holdsworth <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent e83ba64 commit 40e7cfd

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

git-p4.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -394,7 +394,7 @@ def system(cmd, ignore_error=False):
394394
sys.stderr.write("executing %s\n" % str(cmd))
395395
retcode = subprocess.call(cmd, shell=expand)
396396
if retcode and not ignore_error:
397-
raise CalledProcessError(retcode, cmd)
397+
raise subprocess.CalledProcessError(retcode, cmd)
398398

399399
return retcode
400400

@@ -404,7 +404,7 @@ def p4_system(cmd):
404404
expand = not isinstance(real_cmd, list)
405405
retcode = subprocess.call(real_cmd, shell=expand)
406406
if retcode:
407-
raise CalledProcessError(retcode, real_cmd)
407+
raise subprocess.CalledProcessError(retcode, real_cmd)
408408

409409
def die_bad_access(s):
410410
die("failure accessing depot: {0}".format(s.rstrip()))
@@ -4169,7 +4169,7 @@ def run(self, args):
41694169
init_cmd.append("--bare")
41704170
retcode = subprocess.call(init_cmd)
41714171
if retcode:
4172-
raise CalledProcessError(retcode, init_cmd)
4172+
raise subprocess.CalledProcessError(retcode, init_cmd)
41734173

41744174
if not P4Sync.run(self, depotPaths):
41754175
return False

0 commit comments

Comments
 (0)