diff options
author | Papoteur <papoteur@mageialinux-online.org> | 2015-10-10 09:16:26 +0200 |
---|---|---|
committer | Papoteur <papoteur@mageialinux-online.org> | 2015-10-10 09:16:26 +0200 |
commit | 142d404aa8cffc9f4785e5347f26036463dedcd4 (patch) | |
tree | c58f4d5c692c945eb10180baadb123d2c3762ad3 /MgaRepo/command.py | |
parent | 3e3e90e699192df60eeafb2ec7a9e087aff97195 (diff) | |
download | mgarepo-142d404aa8cffc9f4785e5347f26036463dedcd4.tar mgarepo-142d404aa8cffc9f4785e5347f26036463dedcd4.tar.gz mgarepo-142d404aa8cffc9f4785e5347f26036463dedcd4.tar.bz2 mgarepo-142d404aa8cffc9f4785e5347f26036463dedcd4.tar.xz mgarepo-142d404aa8cffc9f4785e5347f26036463dedcd4.zip |
Apply 2to3-3.4
Diffstat (limited to 'MgaRepo/command.py')
-rw-r--r-- | MgaRepo/command.py | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/MgaRepo/command.py b/MgaRepo/command.py index 9028b3b..9fc9cef 100644 --- a/MgaRepo/command.py +++ b/MgaRepo/command.py @@ -1,7 +1,7 @@ #!/usr/bin/python from MgaRepo import SilentError, Error, config import sys, os -import urlparse +import urllib.parse import optparse __all__ = ["OptionParser", "do_command", "default_parent"] @@ -31,7 +31,7 @@ class OptionParser(optparse.OptionParser): return optparse.OptionParser.format_help(self, formatter) def error(self, msg): - raise Error, msg + raise Error(msg) def do_command(parse_options_func, main_func): try: @@ -39,7 +39,7 @@ def do_command(parse_options_func, main_func): main_func(**opt.__dict__) except SilentError: sys.exit(1) - except Error, e: + except Error as e: sys.stderr.write("error: %s\n" % str(e)) sys.exit(1) except KeyboardInterrupt: @@ -51,11 +51,11 @@ def default_parent(url): if url.find("://") == -1: default_parent = config.get("global", "default_parent") if not default_parent: - raise Error, "received a relative url, " \ - "but default_parent was not setup" - parsed = list(urlparse.urlparse(default_parent)) + raise Error("received a relative url, " \ + "but default_parent was not setup") + parsed = list(urllib.parse.urlparse(default_parent)) parsed[2] = os.path.normpath(parsed[2] + "/" + url) - url = urlparse.urlunparse(parsed) + url = urllib.parse.urlunparse(parsed) return url # vim:et:ts=4:sw=4 |