diff --git a/pyencrypt/loader.py b/pyencrypt/loader.py index 14c3ff9..842531c 100644 --- a/pyencrypt/loader.py +++ b/pyencrypt/loader.py @@ -26,7 +26,7 @@ def __init__(self, path) -> None: self.__private_key = '' self.__cipher_key = '' - def get_filename(self, fullname: str) -> _Path: + def get_filename(self, fullname: str) -> str: return self.path def get_data(self, path: _Path) -> bytes: @@ -51,7 +51,8 @@ def find_spec(self, else: file_path = Path(path[0]) / f'{fullname.rsplit(".",1)[-1]}.pye' else: - file_path = f'{fullname}.pye' + file_path = Path(f'{fullname}.pye') + file_path = file_path.absolute().as_posix() if not os.path.exists(file_path): return None loader = EncryptFileLoader(file_path) diff --git a/pyencrypt/setup.py b/pyencrypt/setup.py index 6b80895..32bfcb1 100644 --- a/pyencrypt/setup.py +++ b/pyencrypt/setup.py @@ -1,8 +1,8 @@ import os from pathlib import Path -from Cython.Build import cythonize from setuptools import setup +from Cython.Build import cythonize path = Path(os.getcwd()) / 'encrypted' / 'loader.py' setup(ext_modules=cythonize(path.as_posix()), )