Skip to content

Commit

Permalink
[fix] use *hidden-submodule*
Browse files Browse the repository at this point in the history
  • Loading branch information
digikar99 committed Jun 11, 2024
1 parent 8e73fed commit 270400b
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/import-export.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,8 @@ Arguments:

(defvar *is-submodule* nil
"Used for coordinating import statements from defpymodule while calling recursively")
(defvar *hidden-submodule* nil
"Used for coordinating import statements from defpymodule while calling recursively")

(defun py-empty-tuple-p (object)
(declare (optimize speed))
Expand Down Expand Up @@ -225,8 +227,6 @@ Arguments:
(cons modname ispkg)
nil))
((eql :hidden)
(import-module (format nil "~A.~A"
pymodule-name modname))
(cons modname
(if ispkg
:hidden
Expand Down Expand Up @@ -266,9 +266,8 @@ Arguments:
;; See https://stackoverflow.com/questions/14812342/matplotlib-has-no-attribute-pyplot
;; We want to preserve this behavior. That is why, we first check if PYMODULE-NAME
;; actually has SUBMODULE as an attribute. If not, we do not process this any further.
(let ((*is-submodule* t))
(collecting
`(import-module ,submodule-fullname))
(let ((*is-submodule* t)
(*hidden-submodule* (eq :hidden submodule-names)))
(appending
(multiple-value-list
(defpymodule* submodule-fullname
Expand All @@ -288,7 +287,8 @@ Arguments:
- The first value is the import form
- The second value is the name of the package in python itself"
(let ((package-in-python (pycall "str" (%pythonize (intern lisp-package)))))
(cond (*is-submodule*
(cond ((and *is-submodule*
(not *hidden-submodule*))
(values nil pymodule-name))
(*lisp-package-supplied-p*
(values
Expand Down

0 comments on commit 270400b

Please sign in to comment.