diff options
author | Joel Rosdahl <joel@rosdahl.net> | 2014-06-23 22:17:45 +0200 |
---|---|---|
committer | Joel Rosdahl <joel@rosdahl.net> | 2014-06-23 22:17:45 +0200 |
commit | 3e7fedf0c05e2c36f6176ace36eeaf1d92471ffe (patch) | |
tree | 9abed823ef3904d2e9ac2143b4de00b9f14f0e88 | |
parent | 3ac33094c2dc633b461853e21fadb5ea81462118 (diff) | |
download | miniircd-3e7fedf0c05e2c36f6176ace36eeaf1d92471ffe.tar.gz miniircd-3e7fedf0c05e2c36f6176ace36eeaf1d92471ffe.zip |
Made miniircd pyflakes clean again
-rwxr-xr-x | miniircd | 9 |
1 files changed, 3 insertions, 6 deletions
@@ -738,8 +738,8 @@ class Server(object): s.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) try: s.bind(("", port)) - except socket.error, x: - self.print_error("Could not bind port %s: %s." % (port, x)) + except socket.error as e: + self.print_error("Could not bind port %s: %s." % (port, e)) sys.exit(1) s.listen(5) serversockets.append(s) @@ -768,6 +768,7 @@ class Server(object): else: (conn, addr) = x.accept() if self.ssl_pem_file: + import ssl try: conn = ssl.wrap_socket( conn, @@ -858,10 +859,6 @@ def main(argv): (options, args) = op.parse_args(argv[1:]) if options.debug: options.verbose = True - if options.ssl_pem_file is not None: - # Only import ssl when needed - global ssl - import ssl if options.ports is None: if options.ssl_pem_file is None: options.ports = "6667" |