Restyling redundant 'except Exception' form

This commit is contained in:
Miroslav Stampar 2013-01-10 15:54:28 +01:00
parent acfeeb4f51
commit 834be1eddc
4 changed files with 4 additions and 4 deletions

View File

@ -24,7 +24,7 @@ def beep():
_linux_wav_play(BEEP_WAV_FILENAME) _linux_wav_play(BEEP_WAV_FILENAME)
else: else:
_speaker_beep() _speaker_beep()
except Exception: except:
_speaker_beep() _speaker_beep()
def _speaker_beep(): def _speaker_beep():

View File

@ -3192,7 +3192,7 @@ def decodeHexValue(value):
try: try:
retVal = applyFunctionRecursively(value, _) retVal = applyFunctionRecursively(value, _)
except Exception: except:
singleTimeWarnMessage("there was a problem decoding value '%s' from expected hexadecimal form" % value) singleTimeWarnMessage("there was a problem decoding value '%s' from expected hexadecimal form" % value)
return retVal return retVal

View File

@ -639,7 +639,7 @@ def _setMetasploit():
_ = ConnectRegistry(None, HKEY_LOCAL_MACHINE) _ = ConnectRegistry(None, HKEY_LOCAL_MACHINE)
_ = OpenKey(_, key) _ = OpenKey(_, key)
retVal = QueryValueEx(_, value)[0] retVal = QueryValueEx(_, value)[0]
except Exception: except:
logger.debug("unable to identify Metasploit installation path via registry key") logger.debug("unable to identify Metasploit installation path via registry key")
return retVal return retVal

View File

@ -500,7 +500,7 @@ def _bruteProcessVariantA(attack_info, hash_regex, suffix, retVal, proc_id, proc
except (UnicodeEncodeError, UnicodeDecodeError): except (UnicodeEncodeError, UnicodeDecodeError):
pass # ignore possible encoding problems caused by some words in custom dictionaries pass # ignore possible encoding problems caused by some words in custom dictionaries
except Exception: except:
warnMsg = "there was a problem while hashing entry: %s. " % repr(word) warnMsg = "there was a problem while hashing entry: %s. " % repr(word)
warnMsg += "Please report by e-mail to %s" % ML warnMsg += "Please report by e-mail to %s" % ML
logger.critical(warnMsg) logger.critical(warnMsg)