Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixing erroneous error in Python module format loader, when explicit path is specified #616

Merged
merged 1 commit into from
Mar 12, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions python/hyperon/runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,7 @@ def try_path(path, metta_mod_name):
"""Load the file as a Python module if it exists"""

#See if we have a ".py" file first, and if not, check for a directory-based python mod
path = path if path.endswith(".py") else os.path.splitext(path)[0] + ".py"
if not os.path.exists(path):
dir_path = os.path.join(os.path.splitext(path)[0], "__init__.py")
if os.path.exists(dir_path):
Expand Down
Loading