Skip to content

Commit 33b250c

Browse files
authored
Merge pull request #587 from Mathics3/add-form-to-output
Move import forms *before* use of PrintForms
2 parents 93d8e89 + f90954b commit 33b250c

1 file changed

Lines changed: 12 additions & 6 deletions

File tree

mathics/core/definitions.py

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -112,17 +112,23 @@ def __init__(
112112
"System`",
113113
"Global`",
114114
)
115+
116+
# Importing "mathics.format" populates the Symbol of the
117+
# PrintForms and OutputForms sets.
118+
#
119+
# If "importlib" is used instead of "import", then we get:
120+
# TypeError: boxes_to_text() takes 1 positional argument but
121+
# 2 were given
122+
# Rocky: this smells of something not quite right in terms of
123+
# modularity.
124+
125+
import mathics.format # noqa
126+
115127
self.printforms = list(PrintForms)
116128
self.outputforms = list(OutputForms)
117129
self.trace_evaluation = False
118130
self.timing_trace_evaluation = False
119131

120-
# This loads all the formatting functions.
121-
# It needs to be early because it can be used in
122-
# messages during the builtins loading.
123-
# Rocky: this smells of something not quite right in terms of modularity.
124-
import mathics.format
125-
126132
if add_builtin:
127133
from mathics.builtin import modules, contribute
128134
from mathics.settings import ROOT_DIR

0 commit comments

Comments
 (0)