Skip to content

Commit

Permalink
Make sure sagemath#26968 is not unfixed after sagemath#35707.
Browse files Browse the repository at this point in the history
Calling initialize-runtime-globals will run set-pathnames and be subject
to the issue described in sagemath#26968.

Thus the workaround introduced in sagemath#35195 has to be done before anything
that may call set-pathnames (e.g. initialize-runtime-globals).
  • Loading branch information
tornaria committed Jun 25, 2023
1 parent 4642fea commit b742776
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/sage/interfaces/maxima_lib.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,12 +133,12 @@
ecl_eval("(require 'maxima \"{}\")".format(MAXIMA_FAS))
else:
ecl_eval("(require 'maxima)")
ecl_eval("(maxima::initialize-runtime-globals)")
ecl_eval("(in-package :maxima)")
ecl_eval("(setq $nolabels t))")
ecl_eval("(defvar *MAXIMA-LANG-SUBDIR* NIL)")
ecl_eval("(set-locale-subdir)")

# This workaround has to happen before any call to (set-pathnames).
# To be safe please do not call anything other than
# (set-locale-subdir) before this block.
try:
ecl_eval("(set-pathnames)")
except RuntimeError:
Expand All @@ -155,6 +155,8 @@
# Call `(set-pathnames)` again to complete its job.
ecl_eval("(set-pathnames)")

ecl_eval("(initialize-runtime-globals)")
ecl_eval("(setq $nolabels t))")
ecl_eval("(defun add-lineinfo (x) x)")
ecl_eval('(defun principal nil (cond ($noprincipal (diverg)) ((not pcprntd) (merror "Divergent Integral"))))')
ecl_eval("(remprop 'mfactorial 'grind)") # don't use ! for factorials (#11539)
Expand Down

0 comments on commit b742776

Please sign in to comment.