Skip to content

Commit 171b9a4

Browse files
committed
fix: 🐛 'PosixPath' object has no attribute 'rpartition'
Closes: #15
1 parent c5fc34c commit 171b9a4

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

pyencrypt/loader.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ def __init__(self, path) -> None:
2626
self.__private_key = ''
2727
self.__cipher_key = ''
2828

29-
def get_filename(self, fullname: str) -> _Path:
29+
def get_filename(self, fullname: str) -> str:
3030
return self.path
3131

3232
def get_data(self, path: _Path) -> bytes:
@@ -51,7 +51,8 @@ def find_spec(self,
5151
else:
5252
file_path = Path(path[0]) / f'{fullname.rsplit(".",1)[-1]}.pye'
5353
else:
54-
file_path = f'{fullname}.pye'
54+
file_path = Path(f'{fullname}.pye')
55+
file_path = file_path.absolute().as_posix()
5556
if not os.path.exists(file_path):
5657
return None
5758
loader = EncryptFileLoader(file_path)

0 commit comments

Comments
 (0)