From 42c481cb4a12a81e88923930e21a661eee967a5f Mon Sep 17 00:00:00 2001 From: Rotzbua Date: Fri, 5 Jan 2024 12:36:36 +0100 Subject: [PATCH] refactor(): use `OSError` exception https://docs.astral.sh/ruff/rules/os-error-alias/ --- scrapy/pipelines/files.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/scrapy/pipelines/files.py b/scrapy/pipelines/files.py index 1990ba825..73064ad10 100644 --- a/scrapy/pipelines/files.py +++ b/scrapy/pipelines/files.py @@ -8,7 +8,6 @@ import functools import hashlib import logging import mimetypes -import os import time from collections import defaultdict from contextlib import suppress @@ -66,7 +65,7 @@ class FSFilesStore: absolute_path = self._get_filesystem_path(path) try: last_modified = absolute_path.stat().st_mtime - except os.error: + except OSError: return {} with absolute_path.open("rb") as f: