aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormrbean-bremen <hansemrbean@googlemail.com>2021-11-24 21:08:40 +0100
committermrbean-bremen <hansemrbean@googlemail.com>2021-11-24 21:35:18 +0100
commit38a5589860a82d8df51a37fbcff5111c48871b33 (patch)
tree4fbf7c75c4c699eac26be7d42099554e983a51ae
parent184a9e72e973138a8f4c0380192d232efc48a617 (diff)
downloadpyfakefs-38a5589860a82d8df51a37fbcff5111c48871b33.tar.gz
Use AnyPath instead of AnyString in create_file and add_real_file
- fixes #648
-rw-r--r--pyfakefs/fake_filesystem.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/pyfakefs/fake_filesystem.py b/pyfakefs/fake_filesystem.py
index a4c58fc..ecaa54a 100644
--- a/pyfakefs/fake_filesystem.py
+++ b/pyfakefs/fake_filesystem.py
@@ -2463,7 +2463,7 @@ class FakeFilesystem:
return current_dir
- def create_file(self, file_path: AnyStr,
+ def create_file(self, file_path: AnyPath,
st_mode: int = S_IFREG | PERM_DEF_FILE,
contents: AnyString = '',
st_size: Optional[int] = None,
@@ -2505,9 +2505,9 @@ class FakeFilesystem:
file_path, st_mode, contents, st_size, create_missing_dirs,
apply_umask, encoding, errors, side_effect=side_effect)
- def add_real_file(self, source_path: AnyStr,
+ def add_real_file(self, source_path: AnyPath,
read_only: bool = True,
- target_path: Optional[AnyStr] = None) -> FakeFile:
+ target_path: Optional[AnyPath] = None) -> FakeFile:
"""Create `file_path`, including all the parent directories along the
way, for an existing real file. The contents of the real file are read
only on demand.