sage_jsmath_macros_easy

1 view
Skip to first unread message

David Roe

unread,
Sep 18, 2010, 11:28:07 PM9/18/10
to sage-devel
Recently I've been running into "NameError: name 'sage_jsmath_macros_easy' is not defined" whenever I make a mistake that generates an error during sage's import.  I tracked this down to the following section of code in sagenb.misc.misc:

try:
    import sage.all
    from sage.misc.latex_macros import sage_jsmath_macros_easy
except ImportError:
    sage_jsmath_macros_easy = [
    ...
    ]
finally:
    jsmath_macros = ',\n'.join(sage_jsmath_macros_easy)

So if you generate an error that's not an ImportError, it's covered up by this code: instead you get a name error.  An obvious fix is to add a block

except Exception:
    sage_jsmath_macros_easy = []
    raise

before the finally.  I haven't been involved with committing code to sagenb; can someone who has comment on this?
David
Reply all
Reply to author
Forward
0 new messages