mirror of
https://github.com/certbot/certbot.git
synced 2026-07-31 18:45:40 +02:00
Replace aliased OSError.
As of Python 3.3, various errors were merged into OSError. https://docs.python.org/3/library/exceptions.html#OSError
This commit is contained in:
@@ -295,7 +295,7 @@ class ApacheConfigurator(common.Configurator):
|
||||
try:
|
||||
with open(ssl_module_location, mode="rb") as f:
|
||||
contents = f.read()
|
||||
except IOError as error:
|
||||
except OSError as error:
|
||||
logger.debug(str(error), exc_info=True)
|
||||
return None
|
||||
return contents
|
||||
@@ -928,7 +928,7 @@ class ApacheConfigurator(common.Configurator):
|
||||
try:
|
||||
socket.inet_aton(addr.get_addr())
|
||||
return socket.gethostbyaddr(addr.get_addr())[0]
|
||||
except (socket.error, socket.herror, socket.timeout):
|
||||
except (OSError, socket.herror, socket.timeout):
|
||||
pass
|
||||
|
||||
return ""
|
||||
@@ -1523,7 +1523,7 @@ class ApacheConfigurator(common.Configurator):
|
||||
# activation (it's not included as default)
|
||||
if not self.parser.parsed_in_current(ssl_fp):
|
||||
self.parser.parse_file(ssl_fp)
|
||||
except IOError:
|
||||
except OSError:
|
||||
logger.critical("Error writing/reading to file in make_vhost_ssl", exc_info=True)
|
||||
raise errors.PluginError("Unable to write/read in make_vhost_ssl")
|
||||
|
||||
|
||||
@@ -153,7 +153,7 @@ class ApacheParser:
|
||||
try:
|
||||
# This is a noop save
|
||||
self.aug.save()
|
||||
except (RuntimeError, IOError):
|
||||
except (OSError, RuntimeError):
|
||||
self._log_save_errors(ex_errs)
|
||||
# Erase Save Notes
|
||||
self.configurator.save_notes = ""
|
||||
@@ -198,7 +198,7 @@ class ApacheParser:
|
||||
ex_errs = self.aug.match("/augeas//error")
|
||||
try:
|
||||
self.aug.save()
|
||||
except IOError:
|
||||
except OSError:
|
||||
self._log_save_errors(ex_errs)
|
||||
raise
|
||||
|
||||
|
||||
Reference in New Issue
Block a user