diff --git a/debpython/namespace.py b/debpython/namespace.py index ecee7204afd9de2e1d3b4a1cda7ac95b16a8f604..9c61a961db2da54ea9460ab8d3d7b8234dbc71aa 100644 --- a/debpython/namespace.py +++ b/debpython/namespace.py @@ -91,7 +91,7 @@ def add_namespace_files(files, package=None, action=None): if action is True: try: open(fpath, 'a').close() - except: + except Exception: log.error('cannot create %s', fpath) else: yield fpath diff --git a/debpython/option.py b/debpython/option.py index 116f807c4775611e5fbed887ca959bcd590044b7..d24341313abe1464439aa7bcbbf2c79081b6c23c 100644 --- a/debpython/option.py +++ b/debpython/option.py @@ -35,7 +35,7 @@ def parse_version_range(option, opt, value): def compile_regexpr(option, opt, value): try: pattern = re.compile(value) - except: + except Exception: raise optparse.OptionValueError('regular expression is not valid') return pattern diff --git a/debpython/tools.py b/debpython/tools.py index ca6ca590dfc5bd750dfa876e3d8eeeff0c5849a0..78979f6958c06a936b0fc2002d6341b6f13ca464 100644 --- a/debpython/tools.py +++ b/debpython/tools.py @@ -198,19 +198,19 @@ def pyinstall(package, vrange): if not exists(dstdir): try: os.makedirs(dstdir) - except: + except Exception: log.error('cannot create %s directory', dstdir) return False if exists(dstfpath): try: os.remove(dstfpath) - except: + except Exception: status = False log.error('cannot replace %s file', dstfpath) continue try: os.link(fpath, dstfpath) - except: + except Exception: status = False log.error('cannot copy %s file to %s', fpath, dstdir) return status diff --git a/debpython/version.py b/debpython/version.py index 2324ccaa764ca6895e3850f784293f85ad469337..ba287a95797c58a57e9284d960243843f18fbb0f 100644 --- a/debpython/version.py +++ b/debpython/version.py @@ -42,13 +42,13 @@ _config.read(['/usr/share/python/debian_defaults', try: DEFAULT = tuple(int(i) for i in _config.get('DEFAULT', 'default-version')[6:].split('.')) -except: +except Exception: log.exception('cannot read debian_defaults') try: SUPPORTED = tuple(tuple(int(j) for j in i.strip()[6:].split('.'))\ for i in _config.get('DEFAULT', 'supported-versions').split(',')) -except: +except Exception: log.exception('cannot read debian_defaults') diff --git a/dh_python2 b/dh_python2 index 79a2cdde231639e1d0ad41b68fa40467452e2978..b266aefaacdc445ef907c9300798eb985cc2a611 100755 --- a/dh_python2 +++ b/dh_python2 @@ -458,7 +458,7 @@ def scan(package, dname=None, clean_dbg_pkg=True): if '-packages/' in root and not file_names: try: os.rmdir(root) - except: + except Exception: pass log.debug("package %s details = %s", package, r) @@ -531,7 +531,7 @@ def main(): # fail now rather than at runtime try: pattern = re.compile(pattern) - except: + except Exception: log.error('regular expression is not valid: %s', pattern) exit(1)