Bug 1295323 - s/CalledProcessError/subprocess.CalledProcessError/ draft
authorRob Wu <rob@robwu.nl>
Mon, 01 Aug 2016 19:01:12 -0700
changeset 400799 b5a2a7c090cfdfd97e62a45251f1d24232b99e41
parent 400444 6e191a55c3d23e83e6a2e72e4e80c1dc21516493
child 528334 fe8b1b7374d193bd40e1c85ffeefb37a96286af1
push id26288
push userbmo:rob@robwu.nl
push dateMon, 15 Aug 2016 22:07:43 +0000
bugs1295323
milestone51.0a1
Bug 1295323 - s/CalledProcessError/subprocess.CalledProcessError/ MozReview-Commit-ID: IxtsQCQbAE2
testing/remotecppunittests.py
testing/xpcshell/remotexpcshelltests.py
--- a/testing/remotecppunittests.py
+++ b/testing/remotecppunittests.py
@@ -71,32 +71,32 @@ class RemoteCPPUnitTests(cppunittests.CP
                     if info.filename.endswith(".so"):
                         print >> sys.stderr, "Pushing %s.." % info.filename
                         remote_file = posixpath.join(self.remote_bin_dir, os.path.basename(info.filename))
                         apk_contents.extract(info, tmpdir)
                         local_file = os.path.join(tmpdir, info.filename)
                         if szip:
                             try:
                                 out = subprocess.check_output([szip, '-d', local_file], stderr=subprocess.STDOUT)
-                            except CalledProcessError:
+                            except subprocess.CalledProcessError:
                                 print >> sys.stderr, "Error calling %s on %s.." % (szip, local_file)
                                 if out:
                                     print >> sys.stderr, out
                         self.device.pushFile(local_file, remote_file)
 
         elif self.options.local_lib:
             for file in os.listdir(self.options.local_lib):
                 if file.endswith(".so"):
                     print >> sys.stderr, "Pushing %s.." % file
                     remote_file = posixpath.join(self.remote_bin_dir, file)
                     local_file = os.path.join(self.options.local_lib, file)
                     if szip:
                         try:
                             out = subprocess.check_output([szip, '-d', local_file], stderr=subprocess.STDOUT)
-                        except CalledProcessError:
+                        except subprocess.CalledProcessError:
                             print >> sys.stderr, "Error calling %s on %s.." % (szip, local_file)
                             if out:
                                 print >> sys.stderr, out
                     self.device.pushFile(local_file, remote_file)
             # Additional libraries may be found in a sub-directory such as "lib/armeabi-v7a"
             for subdir in ["assets", "lib"]:
                 local_arm_lib = os.path.join(self.options.local_lib, subdir)
                 if os.path.isdir(local_arm_lib):
@@ -104,17 +104,17 @@ class RemoteCPPUnitTests(cppunittests.CP
                         for file in files:
                             if (file.endswith(".so")):
                                 print >> sys.stderr, "Pushing %s.." % file
                                 remote_file = posixpath.join(self.remote_bin_dir, file)
                                 local_file = os.path.join(root, file)
                                 if szip:
                                     try:
                                         out = subprocess.check_output([szip, '-d', local_file], stderr=subprocess.STDOUT)
-                                    except CalledProcessError:
+                                    except subprocess.CalledProcessError:
                                         print >> sys.stderr, "Error calling %s on %s.." % (szip, local_file)
                                         if out:
                                             print >> sys.stderr, out
                                 self.device.pushFile(local_file, remote_file)
 
     def push_progs(self, progs):
         for local_file in progs:
             remote_file = posixpath.join(self.remote_bin_dir, os.path.basename(local_file))
--- a/testing/xpcshell/remotexpcshelltests.py
+++ b/testing/xpcshell/remotexpcshelltests.py
@@ -451,17 +451,17 @@ class XPCShellRemote(xpcshell.XPCShellTe
                     if info.filename.endswith(".so"):
                         print >> sys.stderr, "Pushing %s.." % info.filename
                         remoteFile = remoteJoin(self.remoteBinDir, os.path.basename(info.filename))
                         self.localAPKContents.extract(info, dir)
                         localFile = os.path.join(dir, info.filename)
                         if szip:
                             try:
                                 out = subprocess.check_output([szip, '-d', localFile], stderr=subprocess.STDOUT)
-                            except CalledProcessError:
+                            except subprocess.CalledProcessError:
                                 print >> sys.stderr, "Error calling %s on %s.." % (szip, localFile)
                                 if out:
                                     print >> sys.stderr, out
                         self.device.pushFile(localFile, remoteFile)
                         pushed_libs_count += 1
             finally:
                 shutil.rmtree(dir)
             return pushed_libs_count
@@ -471,17 +471,17 @@ class XPCShellRemote(xpcshell.XPCShellTe
                 print >> sys.stderr, "Pushing %s.." % file
                 if 'libxul' in file:
                     print >> sys.stderr, "This is a big file, it could take a while."
                 localFile = os.path.join(self.localLib, file)
                 remoteFile = remoteJoin(self.remoteBinDir, file)
                 if szip:
                     try:
                         out = subprocess.check_output([szip, '-d', localFile], stderr=subprocess.STDOUT)
-                    except CalledProcessError:
+                    except subprocess.CalledProcessError:
                         print >> sys.stderr, "Error calling %s on %s.." % (szip, localFile)
                         if out:
                             print >> sys.stderr, out
                 self.device.pushFile(localFile, remoteFile)
                 pushed_libs_count += 1
 
         # Additional libraries may be found in a sub-directory such as "lib/armeabi-v7a"
         localArmLib = os.path.join(self.localLib, "lib")
@@ -490,17 +490,17 @@ class XPCShellRemote(xpcshell.XPCShellTe
                 for file in files:
                     if (file.endswith(".so")):
                         print >> sys.stderr, "Pushing %s.." % file
                         localFile = os.path.join(root, file)
                         remoteFile = remoteJoin(self.remoteBinDir, file)
                         if szip:
                             try:
                                 out = subprocess.check_output([szip, '-d', localFile], stderr=subprocess.STDOUT)
-                            except CalledProcessError:
+                            except subprocess.CalledProcessError:
                                 print >> sys.stderr, "Error calling %s on %s.." % (szip, localFile)
                                 if out:
                                     print >> sys.stderr, out
                         self.device.pushFile(localFile, remoteFile)
                         pushed_libs_count += 1
 
         return pushed_libs_count