diff options
author | Lucas Hoffmann <l-m-h@web.de> | 2016-07-14 14:31:24 +0200 |
---|---|---|
committer | Lucas Hoffmann <l-m-h@web.de> | 2016-12-09 11:26:19 +0100 |
commit | 84c79143dcf0a56112d8703f24052ca1f5f2832c (patch) | |
tree | e824421a44e77464f262f344bc0f4b87d610ea0c /alot | |
parent | fe748a7f47fb61d46dd88c270c2329e6ff19a895 (diff) |
Fix except syntax
Diffstat (limited to 'alot')
-rw-r--r-- | alot/__main__.py | 6 | ||||
-rw-r--r-- | alot/commands/envelope.py | 4 | ||||
-rw-r--r-- | alot/settings/checks.py | 4 | ||||
-rw-r--r-- | alot/settings/utils.py | 3 | ||||
-rw-r--r-- | alot/ui.py | 2 | ||||
-rw-r--r-- | alot/widgets/globals.py | 2 |
6 files changed, 11 insertions, 10 deletions
diff --git a/alot/__main__.py b/alot/__main__.py index 6202daf1..6bdd129c 100644 --- a/alot/__main__.py +++ b/alot/__main__.py @@ -110,7 +110,7 @@ def main(): args = Options() try: args.parseOptions() # When given no argument, parses sys.argv[1:] - except usage.UsageError, errortext: + except usage.UsageError as errortext: print '%s' % errortext print 'Try --help for usage details.' sys.exit(1) @@ -155,7 +155,7 @@ def main(): try: settings.read_config(alotconfig) settings.read_notmuch_config(notmuchconfig) - except (ConfigError, OSError, IOError), e: + except (ConfigError, OSError, IOError) as e: sys.exit(e) # store options given by config swiches to the settingsManager: @@ -179,7 +179,7 @@ def main(): cmdstring += ' ' + args.subOptions.rest else: cmdstring = settings.get('initial_command') - except CommandParseError, e: + except CommandParseError as e: sys.exit(e) # set up and start interface diff --git a/alot/commands/envelope.py b/alot/commands/envelope.py index 64d5edea..2c35c2aa 100644 --- a/alot/commands/envelope.py +++ b/alot/commands/envelope.py @@ -204,7 +204,7 @@ class SendCommand(Command): self.mail = self.envelope.construct_mail() self.mail['Date'] = email.Utils.formatdate(localtime=True) self.mail = email_as_string(self.mail) - except GPGProblem, e: + except GPGProblem as e: ui.clear_notify([clearme]) ui.notify(e.message, priority='error') return @@ -487,7 +487,7 @@ class SignCommand(Command): keyid = str(' '.join(self.keyid)) try: key = crypto.get_key(keyid, validate=True, sign=True) - except GPGProblem, e: + except GPGProblem as e: envelope.sign = False ui.notify(e.message, priority='error') return diff --git a/alot/settings/checks.py b/alot/settings/checks.py index fd44fe66..cf7b370e 100644 --- a/alot/settings/checks.py +++ b/alot/settings/checks.py @@ -43,7 +43,7 @@ def attr_triple(value): mono = AttrSpec(acc['1fg'], acc['1bg'], 1) normal = AttrSpec(acc['16fg'], acc['16bg'], 16) high = AttrSpec(acc['256fg'], acc['256bg'], 256) - except AttrSpecError, e: + except AttrSpecError as e: raise ValidateError(e.message) return mono, normal, high @@ -142,5 +142,5 @@ def gpg_key(value): """ try: return crypto.get_key(value) - except GPGProblem, e: + except GPGProblem as e: raise ValidateError(e.message) diff --git a/alot/settings/utils.py b/alot/settings/utils.py index f46a8caf..2048a36c 100644 --- a/alot/settings/utils.py +++ b/alot/settings/utils.py @@ -27,7 +27,8 @@ def read_config(configpath=None, specpath=None, checks={}): except ConfigObjError as e: raise ConfigError(e) except IOError: - raise ConfigError('Could not read %s and/or %s' % (configpath, specpath)) + raise ConfigError('Could not read %s and/or %s' + % (configpath, specpath)) except UnboundLocalError: # this works around a bug in configobj msg = '%s is malformed. Check for sections without parents..' @@ -128,7 +128,7 @@ class UI(object): if not self._locked: try: self.apply_commandline(cmdline) - except CommandParseError, e: + except CommandParseError as e: self.notify(e.message, priority='error') # move keys are always passed elif cmdline in ['move up', 'move down', 'move page up', diff --git a/alot/widgets/globals.py b/alot/widgets/globals.py index f4a5659e..f31f0aa7 100644 --- a/alot/widgets/globals.py +++ b/alot/widgets/globals.py @@ -140,7 +140,7 @@ class CompleteEdit(urwid.Edit): self.completions += self.completer.complete(self.edit_text, self.edit_pos) self.focus_in_clist = 1 - except CompletionError, e: + except CompletionError as e: if self.on_error is not None: self.on_error(e) |