Skip to content

Commit

Permalink
Use AnyPath instead of AnyString in create_file and add_real_file
Browse files Browse the repository at this point in the history
- fixes #648
  • Loading branch information
mrbean-bremen committed Nov 24, 2021
1 parent 184a9e7 commit 38a5589
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pyfakefs/fake_filesystem.py
Original file line number Diff line number Diff line change
Expand Up @@ -2463,7 +2463,7 @@ def create_dir(self, directory_path: AnyPath,

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,
Expand Down Expand Up @@ -2505,9 +2505,9 @@ def create_file(self, file_path: AnyStr,
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.
Expand Down

0 comments on commit 38a5589

Please sign in to comment.