Commit 5f2c54b1 authored by scoder's avatar scoder Committed by GitHub

Merge pull request #2321 from gabrieldemarmiesse/pep8tify_runtests_try_except

Formatted runtests.py to make it respect the pep8 conventions of try...except.
parents a4ed582d d6124ba6
......@@ -101,13 +101,17 @@ def get_distutils_distro(_cache=[]):
if sys.platform == 'win32':
# TODO: Figure out why this hackery (see http://thread.gmane.org/gmane.comp.python.cython.devel/8280/).
config_files = distutils_distro.find_config_files()
try: config_files.remove('setup.cfg')
except ValueError: pass
try:
config_files.remove('setup.cfg')
except ValueError:
pass
distutils_distro.parse_config_files(config_files)
cfgfiles = distutils_distro.find_config_files()
try: cfgfiles.remove('setup.cfg')
except ValueError: pass
try:
cfgfiles.remove('setup.cfg')
except ValueError:
pass
distutils_distro.parse_config_files(cfgfiles)
_cache.append(distutils_distro)
return distutils_distro
......@@ -1215,8 +1219,10 @@ def run_forked_test(result, run_func, test_name, fork=True):
raise Exception("Tests in module '%s' exited with status %d" %
(module_name, result_code))
finally:
try: os.unlink(result_file)
except: pass
try:
os.unlink(result_file)
except:
pass
class PureDoctestTestCase(unittest.TestCase):
def __init__(self, module_name, module_path):
......@@ -2157,8 +2163,10 @@ def runtests(options, cmd_args, coverage=None):
if xml_output_dir:
from Cython.Tests.xmlrunner import XMLTestRunner
if not os.path.exists(xml_output_dir):
try: os.makedirs(xml_output_dir)
except OSError: pass # concurrency issue?
try:
os.makedirs(xml_output_dir)
except OSError:
pass # concurrency issue?
test_runner = XMLTestRunner(output=xml_output_dir,
verbose=options.verbosity > 0)
if options.failfast:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment