Explorar o código

Use the "as" keyword for exception mathing in a try/except block

Guillaume Ayoub %!s(int64=14) %!d(string=hai) anos
pai
achega
fc166da8ba
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      radicale/__init__.py

+ 1 - 1
radicale/__init__.py

@@ -84,7 +84,7 @@ class HTTPSServer(HTTPServer):
             filename = config.get("server", name)
             try:
                 open(filename, "r").close()
-            except IOError, (_, message):
+            except IOError as (_, message):
                 log.LOGGER.warn(
                     "Error while reading SSL %s %r: %s" % (
                         name, filename, message))