From 3e7fedf0c05e2c36f6176ace36eeaf1d92471ffe Mon Sep 17 00:00:00 2001 From: Joel Rosdahl Date: Mon, 23 Jun 2014 22:17:45 +0200 Subject: Made miniircd pyflakes clean again --- miniircd | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/miniircd b/miniircd index 22f8773..015e054 100755 --- a/miniircd +++ b/miniircd @@ -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" -- cgit v1.2.3