1
0
mirror of https://github.com/openSUSE/osc.git synced 2024-11-14 00:06:15 +01:00

python3 compatibility: raise

support for old style exceptions has been removed from python3
This commit is contained in:
Michal Vyskocil 2013-04-09 12:54:54 +02:00 committed by Adrian Schröter
parent 7f2031558c
commit b534ae0a6a
2 changed files with 3 additions and 3 deletions

View File

@ -2955,7 +2955,7 @@ def check_store_version(dir):
msg = 'The osc metadata of your working copy "%s"' % dir msg = 'The osc metadata of your working copy "%s"' % dir
msg += '\nhas __store_version__ = %s, but it should be %s' % (v, __store_version__) msg += '\nhas __store_version__ = %s, but it should be %s' % (v, __store_version__)
msg += '\nPlease do a fresh checkout or update your client. Sorry about the inconvenience.' msg += '\nPlease do a fresh checkout or update your client. Sorry about the inconvenience.'
raise oscerr.WorkingCopyWrongVersion, msg raise oscerr.WorkingCopyWrongVersion(msg)
def meta_get_packagelist(apiurl, prj, deleted=None): def meta_get_packagelist(apiurl, prj, deleted=None):

View File

@ -277,7 +277,7 @@ class myProxyHTTPSConnection(M2Crypto.httpslib.ProxyHTTPSConnection, HTTPSConnec
#real host/port to be used to make CONNECT request to proxy #real host/port to be used to make CONNECT request to proxy
proto, rest = urllib.splittype(url) proto, rest = urllib.splittype(url)
if proto is None: if proto is None:
raise ValueError, "unknown URL type: %s" % url raise ValueError("unknown URL type: %s" % url)
#get host #get host
host, rest = urllib.splithost(rest) host, rest = urllib.splithost(rest)
#try to get port #try to get port
@ -287,7 +287,7 @@ class myProxyHTTPSConnection(M2Crypto.httpslib.ProxyHTTPSConnection, HTTPSConnec
try: try:
port = self._ports[proto] port = self._ports[proto]
except KeyError: except KeyError:
raise ValueError, "unknown protocol for: %s" % url raise ValueError("unknown protocol for: %s" % url)
self._real_host = host self._real_host = host
self._real_port = int(port) self._real_port = int(port)
M2Crypto.httpslib.HTTPSConnection.putrequest(self, method, url, skip_host, skip_accept_encoding) M2Crypto.httpslib.HTTPSConnection.putrequest(self, method, url, skip_host, skip_accept_encoding)