diff --git a/piwik/indico_piwik/piwik.py b/piwik/indico_piwik/piwik.py index 14681fb..ebf692c 100644 --- a/piwik/indico_piwik/piwik.py +++ b/piwik/indico_piwik/piwik.py @@ -5,7 +5,6 @@ # them and/or modify them under the terms of the MIT License; # see the LICENSE file for more details. -import socket from urllib.parse import urlparse import requests @@ -64,7 +63,7 @@ class PiwikRequest: """Returns the raw results from the API""" try: response = requests.get(query_url, timeout=timeout) - except socket.timeout: + except TimeoutError: current_plugin.logger.warning('Timeout contacting Piwik server') return default_response except Exception: diff --git a/ruff.toml b/ruff.toml index e4939a3..c047124 100644 --- a/ruff.toml +++ b/ruff.toml @@ -1,4 +1,4 @@ -target-version = 'py39' +target-version = 'py312' line-length = 120 extend-exclude = ['docs', 'htmlcov', '*.egg-info'] @@ -49,6 +49,7 @@ ignore = [ 'RUF015', # not always more readable, and we don't do it for huge lists 'RUF022', # autofix messes up out formatting instead of just sorting 'RUF027', # also triggers on i18n functions -> too noisy for now + 'UP038', # it looks kind of weird and it slower than a tuple 'D205', # too many docstrings which have no summary line 'D301', # https://github.com/astral-sh/ruff/issues/8696 'D1', # we have way too many missing docstrings :(