Skip to content

Commit

Permalink
Use import-path from Hyrule.
Browse files Browse the repository at this point in the history
  • Loading branch information
Kodiologist committed May 20, 2024
1 parent 69e32ee commit c986ff3
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions simalq/quest_definition/__init__.hy
Original file line number Diff line number Diff line change
Expand Up @@ -170,8 +170,7 @@ quest definitions from other files in this directory."
(setv builtin-quests (dfor
; Every module in this directory should have the members `name` and
; `quest-fn`.
[finder m _] (hy.I.pkgutil.walk-packages __path__)
:setv spec (.find-spec finder m)
:setv m (hy.I.importlib/util.module-from-spec spec)
:do (.loader.exec-module spec m)
p (.iterdir (hy.I.pathlib.Path (get __path__ 0)))
:if (not-in p.name ["__init__.hy" "__pycache__"])
:setv m (hy.I.hyrule.import-path p)
m.name m.quest-fn))

0 comments on commit c986ff3

Please sign in to comment.