Skip to content

Commit 58d6771

Browse files
committed
Minor
1 parent 0072e73 commit 58d6771

1 file changed

Lines changed: 10 additions & 9 deletions

File tree

‎setup.py‎

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -362,16 +362,7 @@ def run_3to2(args=None):
362362
"""
363363
args = BASE_ARGS_3TO2 if args is None else BASE_ARGS_3TO2 + args
364364
try:
365-
# HACK: workaround for 3to2 never returning non-zero
366-
# when using the -j option.
367365
proc = subprocess.Popen(["3to2"] + args, stderr=subprocess.PIPE)
368-
num_errors = 0
369-
while proc.poll() is None:
370-
line = proc.stderr.readline()
371-
sys.stderr.write(line)
372-
num_errors += line.count(": ParseError: ")
373-
if proc.returncode or num_errors:
374-
raise Exception("lib3to2 parsing error")
375366
except OSError:
376367
for path in glob.glob("*.egg"):
377368
if os.path.isdir(path) and not path in sys.path:
@@ -383,6 +374,16 @@ def run_3to2(args=None):
383374
else:
384375
if lib3to2_main("lib3to2.fixes", args):
385376
raise Exception("lib3to2 parsing error")
377+
else:
378+
# HACK: workaround for 3to2 never returning non-zero
379+
# when using the -j option.
380+
num_errors = 0
381+
while proc.poll() is None:
382+
line = proc.stderr.readline()
383+
sys.stderr.write(line)
384+
num_errors += line.count(": ParseError: ")
385+
if proc.returncode or num_errors:
386+
raise Exception("lib3to2 parsing error")
386387

387388

388389
def write_py2k_header(file_list):

0 commit comments

Comments
 (0)