diff options
| author | Collin Anderson <cmawebsite@gmail.com> | 2017-11-16 12:39:20 -0500 |
|---|---|---|
| committer | Collin Anderson <cmawebsite@gmail.com> | 2017-11-16 13:34:13 -0500 |
| commit | 261d4d8185ec710ea2a5568c76395860834f7246 (patch) | |
| tree | 077113742824c7a6850bcbd72e447e5fc2752166 /src/etc | |
| parent | c81f201d48c4f25d32f8b0f76103c9f794d37851 (diff) | |
| download | rust-261d4d8185ec710ea2a5568c76395860834f7246.tar.gz rust-261d4d8185ec710ea2a5568c76395860834f7246.zip | |
fix some python3 incompatibilities
Diffstat (limited to 'src/etc')
| -rwxr-xr-x | src/etc/indenter | 2 | ||||
| -rwxr-xr-x | src/etc/sugarise-doc-comments.py | 4 | ||||
| -rw-r--r-- | src/etc/test-float-parse/runtests.py | 6 |
3 files changed, 8 insertions, 4 deletions
diff --git a/src/etc/indenter b/src/etc/indenter index b3eed6a1443..21bfc448ae2 100755 --- a/src/etc/indenter +++ b/src/etc/indenter @@ -13,7 +13,7 @@ while True: if more_re.match(line): indent += 1 - print "%03d %s%s" % (indent, " " * indent, line.strip()) + print("%03d %s%s" % (indent, " " * indent, line.strip())) if less_re.match(line): indent -= 1 diff --git a/src/etc/sugarise-doc-comments.py b/src/etc/sugarise-doc-comments.py index 62870f3ed47..ac2223f4ace 100755 --- a/src/etc/sugarise-doc-comments.py +++ b/src/etc/sugarise-doc-comments.py @@ -50,11 +50,11 @@ def block_trim(s): lns = lns[:-1] # remove leading horizontal whitespace - n = sys.maxint + n = sys.maxsize for ln in lns: if ln.strip(): n = min(n, len(re.search('^\s*', ln).group())) - if n != sys.maxint: + if n != sys.maxsize: lns = [ln[n:] for ln in lns] # strip trailing whitespace diff --git a/src/etc/test-float-parse/runtests.py b/src/etc/test-float-parse/runtests.py index bc141877b37..75c92b9b15c 100644 --- a/src/etc/test-float-parse/runtests.py +++ b/src/etc/test-float-parse/runtests.py @@ -97,11 +97,15 @@ from collections import namedtuple from subprocess import Popen, check_call, PIPE from glob import glob import multiprocessing -import Queue import threading import ctypes import binascii +try: # Python 3 + import queue as Queue +except ImportError: # Python 2 + import Queue + NUM_WORKERS = 2 UPDATE_EVERY_N = 50000 INF = namedtuple('INF', '')() |
