Skip to content
This repository has been archived by the owner on Nov 6, 2022. It is now read-only.

Commit

Permalink
Don't use base except clauses
Browse files Browse the repository at this point in the history
  • Loading branch information
Hugo Osvaldo Barrera committed May 11, 2018
1 parent 6126659 commit f6a773f
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion caffeine/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -447,7 +447,7 @@ def main():
try:
hours = int(parts[0])
minutes = int(parts[1])
except:
except ValueError:
print("Invalid time argument.")
sys.exit(2)

Expand Down
4 changes: 2 additions & 2 deletions caffeine/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,12 @@ def getProcesses():
for pid in os.listdir("/proc/"):
try:
pid = int(pid)
except:
except ValueError:
continue

try:
processName = getProcessName(pid).lower()
except:
except Exception:
continue

processList.append((processName, pid))
Expand Down
4 changes: 2 additions & 2 deletions scripts/generate_pot.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ def scan(nodelist):
try:
try:
return scan(parse(fp.read()))
except:
except Exception:
print('Syntax Error in file %r' % filename, file=sys.stderr)
finally:
fp.close()
Expand All @@ -115,7 +115,7 @@ def scan_glade_file(filename):
"""Scan a glade file for translatable strings."""
try:
doc = minidom.parse(filename)
except:
except Exception:
print('Syntax Error in file %r' % filename, file=sys.stderr)
for element in doc.getElementsByTagName('property'):
if element.getAttribute('translatable') == 'yes':
Expand Down

0 comments on commit f6a773f

Please sign in to comment.