Skip to content

Commit

Permalink
Merge pull request #616 from luketpeterson/main
Browse files Browse the repository at this point in the history
Fixing erroneous error in Python module format loader, when explicit path is specified
  • Loading branch information
vsbogd authored Mar 12, 2024
2 parents f867494 + 6462379 commit 1d2bc51
Showing 1 changed file with 1 addition and 0 deletions.
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

0 comments on commit 1d2bc51

Please sign in to comment.