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 <jholdsworth@nvidia.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Joel Holdsworth committed Jan 6, 2022 at 21:41 UTC 40e7cfdd46eb14e63ae4238e3a067d955de54a3d
1 file changed +3 -3
git-p4.py
+3 -3
@@ -394,7 +394,7 @@ def system(cmd, ignore_error=False):
394 sys.stderr.write("executing %s\n" % str(cmd))
395 retcode = subprocess.call(cmd, shell=expand)
396 if retcode and not ignore_error:
397 - raise CalledProcessError(retcode, cmd)
397 + raise subprocess.CalledProcessError(retcode, cmd)
398
399 return retcode
400
@@ -404,7 +404,7 @@ def p4_system(cmd):
404 expand = not isinstance(real_cmd, list)
405 retcode = subprocess.call(real_cmd, shell=expand)
406 if retcode:
407 - raise CalledProcessError(retcode, real_cmd)
407 + raise subprocess.CalledProcessError(retcode, real_cmd)
408
409 def die_bad_access(s):
410 die("failure accessing depot: {0}".format(s.rstrip()))
@@ -4169,7 +4169,7 @@ class P4Clone(P4Sync):
4169 init_cmd.append("--bare")
4170 retcode = subprocess.call(init_cmd)
4171 if retcode:
4172 - raise CalledProcessError(retcode, init_cmd)
4172 + raise subprocess.CalledProcessError(retcode, init_cmd)
4173
4174 if not P4Sync.run(self, depotPaths):
4175 return False