diff options
author | Joel Holdsworth <jholdsworth@nvidia.com> | 2022-01-07 00:41:56 +0300 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2022-01-07 02:05:22 +0300 |
commit | 40e7cfdd46eb14e63ae4238e3a067d955de54a3d (patch) | |
tree | d9c009c4b3f2b817c63dbec804a95a6d39a2f07c | |
parent | e83ba647f7c61cf945690d6a0bd8c172a6498dc8 (diff) |
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>
-rwxr-xr-x | git-p4.py | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -394,7 +394,7 @@ def system(cmd, ignore_error=False): sys.stderr.write("executing %s\n" % str(cmd)) retcode = subprocess.call(cmd, shell=expand) if retcode and not ignore_error: - raise CalledProcessError(retcode, cmd) + raise subprocess.CalledProcessError(retcode, cmd) return retcode @@ -404,7 +404,7 @@ def p4_system(cmd): expand = not isinstance(real_cmd, list) retcode = subprocess.call(real_cmd, shell=expand) if retcode: - raise CalledProcessError(retcode, real_cmd) + raise subprocess.CalledProcessError(retcode, real_cmd) def die_bad_access(s): die("failure accessing depot: {0}".format(s.rstrip())) @@ -4169,7 +4169,7 @@ class P4Clone(P4Sync): init_cmd.append("--bare") retcode = subprocess.call(init_cmd) if retcode: - raise CalledProcessError(retcode, init_cmd) + raise subprocess.CalledProcessError(retcode, init_cmd) if not P4Sync.run(self, depotPaths): return False |