From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pigeon.gentoo.org ([208.92.234.80] helo=lists.gentoo.org) by finch.gentoo.org with esmtp (Exim 4.60) (envelope-from ) id 1RgffA-00046O-1W for garchives@archives.gentoo.org; Fri, 30 Dec 2011 16:50:36 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 4FA9D21C04C; Fri, 30 Dec 2011 16:50:29 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id 10A2521C04C for ; Fri, 30 Dec 2011 16:50:28 +0000 (UTC) Received: from pelican.gentoo.org (unknown [66.219.59.40]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 7320D1B4059 for ; Fri, 30 Dec 2011 16:50:28 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by pelican.gentoo.org (Postfix) with ESMTP id E17E980043 for ; Fri, 30 Dec 2011 16:50:27 +0000 (UTC) From: "Anthony G. Basile" To: gentoo-commits@lists.gentoo.org Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Anthony G. Basile" Message-ID: Subject: [gentoo-commits] proj/webapp-config:master commit in: WebappConfig/ X-VCS-Repository: proj/webapp-config X-VCS-Files: WebappConfig/config.py WebappConfig/content.py WebappConfig/dotconfig.py WebappConfig/permissions.py WebappConfig/sandbox.py WebappConfig/worker.py WebappConfig/wrapper.py X-VCS-Directories: WebappConfig/ X-VCS-Committer: blueness X-VCS-Committer-Name: Anthony G. Basile X-VCS-Revision: ab63707059e517154e3cd5b0f704384e8c74cea0 Date: Fri, 30 Dec 2011 16:50:27 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: quoted-printable X-Archives-Salt: fe189b8f-c954-4d6a-bdc1-f492cdb03348 X-Archives-Hash: adeda1e3a0d035212c02c038a68f270b commit: ab63707059e517154e3cd5b0f704384e8c74cea0 Author: Arfrever gentoo org> AuthorDate: Fri Dec 30 16:49:57 2011 +0000 Commit: Anthony G. Basile gentoo org> CommitDate: Fri Dec 30 16:50:11 2011 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=3Dproj/webapp-config= .git;a=3Dcommit;h=3Dab637070 Update syntax of setting exceptions for compatibility with Python 3. Reported-By: Arfrever gentoo.org> Signed-off-by: Anthony G. Basile 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, opti= on) - except Exception, e: + except Exception as e: error =3D '\nThere is a problem with your configuration file= or' \ ' an environment variable.\n' \ 'webapp-config tried to read the variable "' + str(optio= n) \ @@ -760,7 +760,7 @@ class Config: =20 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)) =20 os.close(fd) - except Exception, e: + except Exception as e: OUT.warn('Failed to write content file ' + dbpath + '!\n= '=20 + '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) =20 - except Exception, e: + except Exception as e: =20 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 =3D grp.getgrgid(ngroup)[2] - except KeyError, e: + except KeyError as e: pass =20 if gid =3D=3D -1: # No success yet. Try to match to the group name try: gid =3D grp.getgrnam(str(group))[2] - except KeyError, e: + except KeyError as e: raise KeyError('The given group "' + str(group) + '" does not exist!') =20 @@ -265,14 +265,14 @@ def get_user(user): try: # Try to match the integer to a user id uid =3D pwd.getpwuid(nuser)[2] - except KeyError, e: + except KeyError as e: pass =20 if uid =3D=3D -1: # No success yet. Try to match to the user name try: uid =3D 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: =20 my_contenttype =3D 'sym' =20 - except Exception, e: + except Exception as e: =20 if self.__v: OUT.warn('Failed to softlink (' + str(e) + ')') @@ -515,7 +515,7 @@ class WebappAdd: =20 my_contenttype =3D 'sym' =20 - except Exception, e: + except Exception as e: =20 if self.__v: OUT.warn('Failed copy symlink (' + str(e) + ')') @@ -530,7 +530,7 @@ class WebappAdd: =20 my_contenttype =3D 'file' =20 - except Exception, e: + except Exception as e: =20 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 =3D=3D "portage": try: import portage - except ImportError, e: + except ImportError as e: OUT.die("Portage libraries not found, quitting:\n%s" % e) =20 return portage.settings['CONFIG_PROTECT'] @@ -90,7 +90,7 @@ def get_root(config): if config.config.get('USER', 'package_manager') =3D=3D "portage": try: import portage - except ImportError, e: + except ImportError as e: OUT.die("Portage libraries not found, quitting:\n%s" % e) =20 return portage.root @@ -128,13 +128,13 @@ def package_installed(full_name, pm): if pm =3D=3D "portage": try: import portage - except ImportError, e: + except ImportError as e: OUT.die("Portage libraries not found, quitting:\n%s" % e) =20 try: t =3D 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]) =3D=3D types.ListType: t =3D [] for cp in e[0]: