diff options
-rwxr-xr-x[-rw-r--r--] | scripts/fuzz_passes.py | 2 | ||||
-rwxr-xr-x[-rw-r--r--] | scripts/fuzz_passes_wast.py | 2 | ||||
-rwxr-xr-x[-rw-r--r--] | scripts/fuzz_relooper.py | 2 | ||||
-rwxr-xr-x | scripts/storage.py | 2 | ||||
-rw-r--r-- | scripts/test/shared.py | 34 | ||||
-rwxr-xr-x | scripts/test/support.py | 2 |
6 files changed, 25 insertions, 19 deletions
diff --git a/scripts/fuzz_passes.py b/scripts/fuzz_passes.py index 960d584f0..42a083b11 100644..100755 --- a/scripts/fuzz_passes.py +++ b/scripts/fuzz_passes.py @@ -105,7 +105,7 @@ try: try: apply_passes(smaller) assert run() == normal - except: + except Exception: # this failed too, so it's a good reduction passes = smaller print '>>> reduction successful' diff --git a/scripts/fuzz_passes_wast.py b/scripts/fuzz_passes_wast.py index 522c1be05..2f2022dd9 100644..100755 --- a/scripts/fuzz_passes_wast.py +++ b/scripts/fuzz_passes_wast.py @@ -96,7 +96,7 @@ try: try: apply_passes(smaller) assert run() == normal - except: + except Exception: # this failed too, so it's a good reduction passes = smaller print '>>> reduction successful' diff --git a/scripts/fuzz_relooper.py b/scripts/fuzz_relooper.py index 52c296e58..16a441936 100644..100755 --- a/scripts/fuzz_relooper.py +++ b/scripts/fuzz_relooper.py @@ -56,7 +56,7 @@ while True: 'fuzz.c']: try: os.unlink(temp) - except: + except OSError: pass # parts diff --git a/scripts/storage.py b/scripts/storage.py index 8ae2e2676..771d145d8 100755 --- a/scripts/storage.py +++ b/scripts/storage.py @@ -31,7 +31,7 @@ def download_revision(force_latest): info = None try: info = json.loads(downloaded) - except: + except ValueError: pass return info['build'] if type(info) == dict else downloaded diff --git a/scripts/test/shared.py b/scripts/test/shared.py index 915cd65e8..65f1f6e74 100644 --- a/scripts/test/shared.py +++ b/scripts/test/shared.py @@ -240,7 +240,7 @@ def setup_waterfall(): subprocess.check_call([CLANG, '-v']) has_vanilla_llvm = True print '...success' - except Exception, e: + except (OSError, subprocess.CalledProcessError) as e: warn('could not run vanilla LLVM from waterfall: ' + str(e) + ', looked for clang at ' + CLANG) @@ -256,25 +256,31 @@ if options.only_prepare: # external tools try: - subprocess.check_call( - [NODEJS, '--version'], stdout=subprocess.PIPE, stderr=subprocess.PIPE) -except: + if NODEJS is not None: + subprocess.check_call( + [NODEJS, '--version'], stdout=subprocess.PIPE, stderr=subprocess.PIPE) +except (OSError, subprocess.CalledProcessError): NODEJS = None +if NODEJS is None: warn('no node found (did not check proper js form)') try: - subprocess.check_call( - [MOZJS, '--version'], stdout=subprocess.PIPE, stderr=subprocess.PIPE) -except: + if MOZJS is not None: + subprocess.check_call( + [MOZJS, '--version'], stdout=subprocess.PIPE, stderr=subprocess.PIPE) +except (OSError, subprocess.CalledProcessError): MOZJS = None +if MOZJS is None: warn('no mozjs found (did not check native wasm support nor asm.js' ' validation)') try: - subprocess.check_call( - [EMCC, '--version'], stdout=subprocess.PIPE, stderr=subprocess.PIPE) -except: + if EMCC is not None: + subprocess.check_call( + [EMCC, '--version'], stdout=subprocess.PIPE, stderr=subprocess.PIPE) +except (OSError, subprocess.CalledProcessError): EMCC = None +if EMCC is None: warn('no emcc found (did not check non-vanilla emscripten/binaryen' ' integration)') @@ -284,7 +290,7 @@ try: [os.path.join(options.binaryen_test, 'emscripten', 'emcc'), '--version'], stdout=subprocess.PIPE, stderr=subprocess.PIPE) has_vanilla_emcc = True -except: +except (OSError, subprocess.CalledProcessError): pass @@ -294,13 +300,13 @@ except: def delete_from_orbit(filename): try: os.unlink(filename) - except: + except OSError: pass if not os.path.exists(filename): return try: shutil.rmtree(filename, ignore_errors=True) - except: + except OSError: pass if not os.path.exists(filename): return @@ -315,7 +321,7 @@ def delete_from_orbit(filename): else: raise shutil.rmtree(filename, onerror=remove_readonly_and_try_again) - except: + except OSError: pass diff --git a/scripts/test/support.py b/scripts/test/support.py index 7b10f229c..9d70abb7f 100755 --- a/scripts/test/support.py +++ b/scripts/test/support.py @@ -26,7 +26,7 @@ def _open_archive(tarfile, tmp_dir): with tempfile.TemporaryFile(mode='w+') as f: try: subprocess.check_call(['tar', '-xvf', tarfile], cwd=tmp_dir, stdout=f) - except: + except Exception: f.seek(0) sys.stderr.write(f.read()) raise |