From: "Anthony G. Basile" <blueness@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/webapp-config:master commit in: WebappConfig/
Date: Fri, 30 Dec 2011 16:50:27 +0000 (UTC) [thread overview]
Message-ID: <ab63707059e517154e3cd5b0f704384e8c74cea0.blueness@gentoo> (raw)
commit: ab63707059e517154e3cd5b0f704384e8c74cea0
Author: Arfrever <arfrever <AT> gentoo <DOT> org>
AuthorDate: Fri Dec 30 16:49:57 2011 +0000
Commit: Anthony G. Basile <blueness <AT> gentoo <DOT> org>
CommitDate: Fri Dec 30 16:50:11 2011 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/webapp-config.git;a=commit;h=ab637070
Update syntax of setting exceptions for compatibility with Python 3.
Reported-By: Arfrever <arfrever <AT> gentoo.org>
Signed-off-by: Anthony G. Basile <blueness <AT> gentoo.org>
---
WebappConfig/config.py | 4 ++--
WebappConfig/content.py | 2 +-
WebappConfig/dotconfig.py | 2 +-
WebappConfig/permissions.py | 8 ++++----
WebappConfig/sandbox.py | 2 +-
WebappConfig/worker.py | 6 +++---
WebappConfig/wrapper.py | 8 ++++----
7 files changed, 16 insertions(+), 16 deletions(-)
diff --git a/WebappConfig/config.py b/WebappConfig/config.py
index 83406e8..4e176da 100644
--- a/WebappConfig/config.py
+++ b/WebappConfig/config.py
@@ -54,7 +54,7 @@ class BashConfigParser(ConfigParser.SafeConfigParser):
def get(self, section, option):
try:
return ConfigParser.SafeConfigParser.get(self, section, option)
- except Exception, e:
+ except Exception as e:
error = '\nThere is a problem with your configuration file or' \
' an environment variable.\n' \
'webapp-config tried to read the variable "' + str(option) \
@@ -760,7 +760,7 @@ class Config:
try:
self.config.read(self.__d['my_etcconfig'])
- except Exception, e:
+ except Exception as e:
OUT.die('The config file '
+ self.config.get('USER', 'my_etcconfig') +
' cannot be read by the configuration parser.'
diff --git a/WebappConfig/content.py b/WebappConfig/content.py
index a469921..1683387 100644
--- a/WebappConfig/content.py
+++ b/WebappConfig/content.py
@@ -304,7 +304,7 @@ class Contents:
os.write(fd, '\n'.join(values))
os.close(fd)
- except Exception, e:
+ except Exception as e:
OUT.warn('Failed to write content file ' + dbpath + '!\n'
+ 'Error was: ' + str(e))
else:
diff --git a/WebappConfig/dotconfig.py b/WebappConfig/dotconfig.py
index 4fc47db..be01126 100644
--- a/WebappConfig/dotconfig.py
+++ b/WebappConfig/dotconfig.py
@@ -260,7 +260,7 @@ class DotConfig:
os.write(fd, '\n'.join(info))
os.close(fd)
- except Exception, e:
+ except Exception as e:
OUT.die('Unable to write to ' + self.__dot_config()
+ '\nError was: ' + str(e))
diff --git a/WebappConfig/permissions.py b/WebappConfig/permissions.py
index 64d5f3d..966c610 100644
--- a/WebappConfig/permissions.py
+++ b/WebappConfig/permissions.py
@@ -217,14 +217,14 @@ def get_group(group):
try:
# Try to match the integer to a group id
gid = grp.getgrgid(ngroup)[2]
- except KeyError, e:
+ except KeyError as e:
pass
if gid == -1:
# No success yet. Try to match to the group name
try:
gid = grp.getgrnam(str(group))[2]
- except KeyError, e:
+ except KeyError as e:
raise KeyError('The given group "' + str(group)
+ '" does not exist!')
@@ -265,14 +265,14 @@ def get_user(user):
try:
# Try to match the integer to a user id
uid = pwd.getpwuid(nuser)[2]
- except KeyError, e:
+ except KeyError as e:
pass
if uid == -1:
# No success yet. Try to match to the user name
try:
uid = pwd.getpwnam(str(user))[2]
- except KeyError, e:
+ except KeyError as e:
raise KeyError('The given user "' + str(user)
+ '" does not exist!')
return uid
diff --git a/WebappConfig/sandbox.py b/WebappConfig/sandbox.py
index a15dd61..10873fa 100644
--- a/WebappConfig/sandbox.py
+++ b/WebappConfig/sandbox.py
@@ -96,7 +96,7 @@ class Sandbox:
if not pid:
try:
self._exec(command, self.env, fd_pipes)
- except Exception, e:
+ except Exception as e:
# We need to catch _any_ exception so that it doesn't
# propagate out of this function and cause exiting
# with anything other than os._exit()
diff --git a/WebappConfig/worker.py b/WebappConfig/worker.py
index a5ee172..0841f4a 100644
--- a/WebappConfig/worker.py
+++ b/WebappConfig/worker.py
@@ -500,7 +500,7 @@ class WebappAdd:
my_contenttype = 'sym'
- except Exception, e:
+ except Exception as e:
if self.__v:
OUT.warn('Failed to softlink (' + str(e) + ')')
@@ -515,7 +515,7 @@ class WebappAdd:
my_contenttype = 'sym'
- except Exception, e:
+ except Exception as e:
if self.__v:
OUT.warn('Failed copy symlink (' + str(e) + ')')
@@ -530,7 +530,7 @@ class WebappAdd:
my_contenttype = 'file'
- except Exception, e:
+ except Exception as e:
if self.__v:
OUT.warn('Failed to hardlink (' + str(e) + ')')
diff --git a/WebappConfig/wrapper.py b/WebappConfig/wrapper.py
index 344d809..91185ff 100644
--- a/WebappConfig/wrapper.py
+++ b/WebappConfig/wrapper.py
@@ -48,7 +48,7 @@ def config_protect(cat, pn, pvr, pm):
if pm == "portage":
try:
import portage
- except ImportError, e:
+ except ImportError as e:
OUT.die("Portage libraries not found, quitting:\n%s" % e)
return portage.settings['CONFIG_PROTECT']
@@ -90,7 +90,7 @@ def get_root(config):
if config.config.get('USER', 'package_manager') == "portage":
try:
import portage
- except ImportError, e:
+ except ImportError as e:
OUT.die("Portage libraries not found, quitting:\n%s" % e)
return portage.root
@@ -128,13 +128,13 @@ def package_installed(full_name, pm):
if pm == "portage":
try:
import portage
- except ImportError, e:
+ except ImportError as e:
OUT.die("Portage libraries not found, quitting:\n%s" % e)
try:
t = portage.db[portage.root]["vartree"].dbapi.match(full_name)
# catch the "ambiguous package" Exception
- except ValueError, e:
+ except ValueError as e:
if type(e[0]) == types.ListType:
t = []
for cp in e[0]:
next reply other threads:[~2011-12-30 16:50 UTC|newest]
Thread overview: 81+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-12-30 16:50 Anthony G. Basile [this message]
-- strict thread matches above, loose matches on Subject: below --
2017-06-22 23:04 [gentoo-commits] proj/webapp-config:master commit in: WebappConfig/ Devan Franchini
2017-02-16 3:09 Devan Franchini
2017-02-16 3:09 Devan Franchini
2017-02-16 3:09 Devan Franchini
2017-02-16 3:09 Devan Franchini
2016-05-12 12:42 Anthony G. Basile
2015-07-11 1:27 Devan Franchini
2015-07-03 4:50 Devan Franchini
2015-07-02 16:49 Devan Franchini
2015-06-19 22:38 Devan Franchini
2015-06-19 19:52 Devan Franchini
2015-06-19 19:52 Devan Franchini
2015-06-19 19:52 Devan Franchini
2015-06-19 19:52 Devan Franchini
2015-06-19 19:52 Devan Franchini
2015-06-19 19:52 Devan Franchini
2015-06-19 19:52 Devan Franchini
2015-06-19 19:52 Devan Franchini
2015-06-19 19:52 Devan Franchini
2015-06-19 19:52 Devan Franchini
2015-06-19 19:52 Devan Franchini
2015-06-19 19:52 Devan Franchini
2015-06-19 19:52 Devan Franchini
2015-06-19 19:52 Devan Franchini
2014-01-25 3:17 Devan Franchini
2014-01-25 3:14 Devan Franchini
2014-01-25 3:14 Devan Franchini
2014-01-25 3:14 Devan Franchini
2014-01-25 3:14 Devan Franchini
2014-01-25 3:14 Devan Franchini
2014-01-25 3:14 Devan Franchini
2014-01-25 3:14 Devan Franchini
2014-01-25 3:14 Devan Franchini
2014-01-25 3:14 Devan Franchini
2014-01-25 3:14 Devan Franchini
2014-01-25 3:14 Devan Franchini
2014-01-02 1:47 Devan Franchini
2014-01-01 1:09 Devan Franchini
2013-10-29 19:13 Devan Franchini
2013-10-29 2:40 Devan Franchini
2013-10-29 2:40 Devan Franchini
2013-10-29 2:40 Devan Franchini
2013-10-29 2:40 Devan Franchini
2013-10-29 2:40 Devan Franchini
2013-10-29 2:18 Devan Franchini
2013-10-29 2:18 Devan Franchini
2013-10-29 2:15 Devan Franchini
2013-10-10 0:35 Devan Franchini
2013-09-26 4:03 Devan Franchini
2013-09-26 3:44 Devan Franchini
2013-09-24 18:20 Anthony G. Basile
2013-09-24 18:20 Anthony G. Basile
2013-09-24 18:20 Anthony G. Basile
2013-09-24 18:20 Anthony G. Basile
2013-08-06 12:28 Anthony G. Basile
2013-08-06 11:00 Anthony G. Basile
2013-08-06 11:00 Anthony G. Basile
2013-08-03 13:24 Anthony G. Basile
2013-08-03 13:24 Anthony G. Basile
2013-08-03 13:24 Anthony G. Basile
2013-04-22 0:52 Anthony G. Basile
2013-03-23 4:05 Anthony G. Basile
2013-03-14 2:19 Anthony G. Basile
2013-03-09 13:45 Anthony G. Basile
2013-02-12 3:40 Anthony G. Basile
2012-06-29 13:00 Anthony G. Basile
2012-06-29 13:00 Anthony G. Basile
2012-06-29 13:00 Anthony G. Basile
2012-06-29 13:00 Anthony G. Basile
2012-06-29 13:00 Anthony G. Basile
2012-06-29 13:00 Anthony G. Basile
2012-06-29 13:00 Anthony G. Basile
2011-12-30 17:52 Anthony G. Basile
2011-12-30 17:50 Anthony G. Basile
2011-12-30 17:34 Anthony G. Basile
2011-12-30 17:23 Anthony G. Basile
2011-12-30 17:11 Anthony G. Basile
2011-12-30 16:42 Anthony G. Basile
2011-08-06 1:51 Anthony G. Basile
2011-06-14 15:23 Anthony G. Basile
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ab63707059e517154e3cd5b0f704384e8c74cea0.blueness@gentoo \
--to=blueness@gentoo.org \
--cc=gentoo-commits@lists.gentoo.org \
--cc=gentoo-dev@lists.gentoo.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox