From 981926035cade84b049dd50ca0c91dca0b7ac4e5 Mon Sep 17 00:00:00 2001 From: mrbean-bremen Date: Tue, 24 Dec 2024 10:02:27 +0100 Subject: [PATCH] Fix an error from mypy - looks like a bug in mypy --- pyfakefs/fake_filesystem.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pyfakefs/fake_filesystem.py b/pyfakefs/fake_filesystem.py index 1f8f536e..fde46a68 100644 --- a/pyfakefs/fake_filesystem.py +++ b/pyfakefs/fake_filesystem.py @@ -2902,7 +2902,8 @@ def makedirs( if not exist_ok or not isinstance(self.resolve(dir_name), FakeDirectory): if self.is_windows_fs and e.errno == errno.ENOTDIR: e.errno = errno.ENOENT - self.raise_os_error(e.errno, e.filename) + # mypy thinks that errno may be None + self.raise_os_error(cast(int, e.errno), e.filename) def _is_of_type( self,