Commits

spirit committed e9e10b0

Minor

Comments (0)

Files changed (1)

     """
     args = BASE_ARGS_3TO2 if args is None else BASE_ARGS_3TO2 + args
     try:
-        # HACK: workaround for 3to2 never returning non-zero
-        # when using the -j option.
         proc = subprocess.Popen(["3to2"] + args, stderr=subprocess.PIPE)
-        num_errors = 0
-        while proc.poll() is None:
-            line = proc.stderr.readline()
-            sys.stderr.write(line)
-            num_errors += line.count(": ParseError: ")
-        if proc.returncode or num_errors:
-            raise Exception("lib3to2 parsing error")
     except OSError:
         for path in glob.glob("*.egg"):
             if os.path.isdir(path) and not path in sys.path:
         else:
             if lib3to2_main("lib3to2.fixes", args):
                 raise Exception("lib3to2 parsing error")
+    else:
+        # HACK: workaround for 3to2 never returning non-zero
+        # when using the -j option.
+        num_errors = 0
+        while proc.poll() is None:
+            line = proc.stderr.readline()
+            sys.stderr.write(line)
+            num_errors += line.count(": ParseError: ")
+        if proc.returncode or num_errors:
+            raise Exception("lib3to2 parsing error")
 
 
 def write_py2k_header(file_list):