We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent dbced03 commit ee9ee52Copy full SHA for ee9ee52
src/androidemu/vfs/file_system.py
@@ -55,12 +55,11 @@ def translate_path(self, filename) -> pathlib.Path:
55
56
file_path = self._root_path.joinpath(filename).resolve()
57
58
- # is_relative_to is new in version 3.9
59
- if not hasattr(file_path, 'is_relative_to'):
+ # when system is macos, the pathlib.Path return was PosixPath, The PosixPath object does not have the is_relative_to method
+ if os.name == "posix":
60
try:
61
file_path.relative_to(self._root_path)
62
except:
63
- # if file_path is not in the subpath of self._root_path, ValueError is raised
64
raise RuntimeError("Emulator tried to read outside vfs ('%s' not in '%s')." % (file_path, self._root_path))
65
else:
66
if not file_path.is_relative_to(self._root_path):
0 commit comments