Mercurial > hg > mercurial-crew
comparison tests/run-tests.py @ 23263:dd51abf0aa17
run-tests: use a try/except ladder instead of looking for a specific version
This ensures we get json instead of simplejson in as many places as possible.
author | Augie Fackler <raf@durin42.com> |
---|---|
date | Mon, 10 Nov 2014 13:20:56 -0500 |
parents | e53f6b72a0e4 |
children | 49cdf51cbc6c |
comparison
equal
deleted
inserted
replaced
23262:86a8658c77ff | 23263:dd51abf0aa17 |
---|---|
59 import Queue as queue | 59 import Queue as queue |
60 from xml.dom import minidom | 60 from xml.dom import minidom |
61 import unittest | 61 import unittest |
62 | 62 |
63 try: | 63 try: |
64 if sys.version_info < (2, 7): | 64 import json |
65 except ImportError: | |
66 try: | |
65 import simplejson as json | 67 import simplejson as json |
66 else: | 68 except ImportError: |
67 import json | 69 json = None |
68 except ImportError: | |
69 json = None | |
70 | 70 |
71 processlock = threading.Lock() | 71 processlock = threading.Lock() |
72 | 72 |
73 # subprocess._cleanup can race with any Popen.wait or Popen.poll on py24 | 73 # subprocess._cleanup can race with any Popen.wait or Popen.poll on py24 |
74 # http://bugs.python.org/issue1731717 for details. We shouldn't be producing | 74 # http://bugs.python.org/issue1731717 for details. We shouldn't be producing |