Hello, I recently updated my Sage and it hasn't been building properly since then. I am using MacOS 10.12.5 and Sage 8.0.beta12. I have attached a copy of the crash report. Please let me know if you could find the problem.
Thanks, Ben Barros -- You received this message because you are subscribed to the Google Groups "sage-support" group. To unsubscribe from this group and stop receiving emails from it, send an email to sage-support+unsubscr...@googlegroups.com. To post to this group, send email to sage-support@googlegroups.com. Visit this group at https://groups.google.com/group/sage-support. For more options, visit https://groups.google.com/d/optout.
*************************************************************************** IPython post-mortem report {'commit_hash': u'5c9c918', 'commit_source': 'installation', 'default_encoding': 'UTF-8', 'ipython_path': '/Users/bbarros/Sage-develop/local/lib/python2.7/site-packages/IPython', 'ipython_version': '5.1.0', 'os_name': 'posix', 'platform': 'Darwin-16.6.0-x86_64-i386-64bit', 'sys_executable': '/Users/bbarros/Sage-develop/local/bin/python', 'sys_platform': 'darwin', 'sys_version': '2.7.13 (default, Jun 2 2017, 10:20:05) \n[GCC 4.2.1 Compatible Apple LLVM 8.1.0 (clang-802.0.41)]'} *************************************************************************** *************************************************************************** Crash traceback: --------------------------------------------------------------------------- --------------------------------------------------------------------------- RuntimeError Python 2.7.13: /Users/bbarros/Sage-develop/local/bin/python Tue Jun 27 12:31:03 2017 A problem occurred executing Python code. Here is the sequence of function calls leading up to the error, with the most recent (innermost) call last. /Users/bbarros/Sage-develop/src/bin/sage-ipython in <module>() 1 #!/usr/bin/env python 2 # -*- coding: utf-8 -*- 3 """ 4 Sage IPython startup script. 5 """ 6 7 from sage.repl.interpreter import SageTerminalApp 8 9 app = SageTerminalApp.instance() ---> 10 app.initialize() global app.initialize = <bound method SageTerminalApp.initialize of <sage.repl.interpreter.SageTerminalApp object at 0x104b42690>> 11 app.start() <decorator-gen-109> in initialize(self=<sage.repl.interpreter.SageTerminalApp object>, argv=None) /Users/bbarros/Sage-develop/local/lib/python2.7/site-packages/traitlets/config/application.pyc in catch_config_error(method=<function initialize>, app=<sage.repl.interpreter.SageTerminalApp object>, *args=(None,), **kwargs={}) 72 TRAITLETS_APPLICATION_RAISE_CONFIG_FILE_ERROR = False 73 else: 74 raise ValueError("Unsupported value for environment variable: 'TRAITLETS_APPLICATION_RAISE_CONFIG_FILE_ERROR' is set to '%s' which is none of {'0', '1', 'false', 'true', ''}."% _envvar ) 75 76 77 @decorator 78 def catch_config_error(method, app, *args, **kwargs): 79 """Method decorator for catching invalid config (Trait/ArgumentErrors) during init. 80 81 On a TraitError (generally caused by bad config), this will print the trait's 82 message, and exit the app. 83 84 For use on init methods, to prevent invoking excepthook on invalid input. 85 """ 86 try: ---> 87 return method(app, *args, **kwargs) method = <function initialize at 0x105d529b0> app = <sage.repl.interpreter.SageTerminalApp object at 0x104b42690> args = (None,) kwargs = {} 88 except (TraitError, ArgumentError) as e: 89 app.print_help() 90 app.log.fatal("Bad config encountered during initialization:") 91 app.log.fatal(str(e)) 92 app.log.debug("Config at the time: %s", app.config) 93 app.exit(1) 94 95 96 class ApplicationError(Exception): 97 pass 98 99 100 class LevelFormatter(logging.Formatter): 101 """Formatter with additional `highlevel` record 102 /Users/bbarros/Sage-develop/local/lib/python2.7/site-packages/IPython/terminal/ipapp.pyc in initialize(self=<sage.repl.interpreter.SageTerminalApp object>, argv=None) 294 295 return super(TerminalIPythonApp, self).parse_command_line(argv) 296 297 @catch_config_error 298 def initialize(self, argv=None): 299 """Do actions after construct, but before starting the app.""" 300 super(TerminalIPythonApp, self).initialize(argv) 301 if self.subapp is not None: 302 # don't bother initializing further, starting subapp 303 return 304 # print self.extra_args 305 if self.extra_args and not self.something_to_run: 306 self.file_to_run = self.extra_args[0] 307 self.init_path() 308 # create the shell --> 309 self.init_shell() self.init_shell = <bound method SageTerminalApp.init_shell of <sage.repl.interpreter.SageTerminalApp object at 0x104b42690>> 310 # and draw the banner 311 self.init_banner() 312 # Now a variety of things that happen after the banner is printed. 313 self.init_gui_pylab() 314 self.init_extensions() 315 self.init_code() 316 317 def init_shell(self): 318 """initialize the InteractiveShell instance""" 319 # Create an InteractiveShell instance. 320 # shell.display_banner should always be False for the terminal 321 # based app, because we call shell.show_banner() by hand below 322 # so the banner shows *before* all extension loading stuff. 323 self.shell = TerminalInteractiveShell.instance(parent=self, 324 profile_dir=self.profile_dir, /Users/bbarros/Sage-develop/local/lib/python2.7/site-packages/sage/repl/interpreter.pyc in init_shell(self=<sage.repl.interpreter.SageTerminalApp object>) 747 self.shell.has_sage_extensions = SAGE_EXTENSION in self.extensions 748 749 # Load the %lprun extension if available 750 try: 751 import line_profiler 752 except ImportError: 753 pass 754 else: 755 self.extensions.append('line_profiler') 756 757 if self.shell.has_sage_extensions: 758 self.extensions.remove(SAGE_EXTENSION) 759 760 # load sage extension here to get a crash if 761 # something is wrong with the sage library --> 762 self.shell.extension_manager.load_extension(SAGE_EXTENSION) self.shell.extension_manager.load_extension = <bound method ExtensionManager.load_extension of <IPython.core.extensions.ExtensionManager object at 0x105f296d0>> global SAGE_EXTENSION = 'sage' 763 764 /Users/bbarros/Sage-develop/local/lib/python2.7/site-packages/IPython/core/extensions.pyc in load_extension(self=<IPython.core.extensions.ExtensionManager object>, module_str='sage') 70 71 Returns the string "already loaded" if the extension is already loaded, 72 "no load function" if the module doesn't have a load_ipython_extension 73 function, or None if it succeeded. 74 """ 75 if module_str in self.loaded: 76 return "already loaded" 77 78 from IPython.utils.syspathcontext import prepended_to_syspath 79 80 with self.shell.builtin_trap: 81 if module_str not in sys.modules: 82 with prepended_to_syspath(self.ipython_extension_dir): 83 __import__(module_str) 84 mod = sys.modules[module_str] ---> 85 if self._call_load_ipython_extension(mod): self._call_load_ipython_extension = <bound method ExtensionManager._call_load_ipython_extension of <IPython.core.extensions.ExtensionManager object at 0x105f296d0>> mod = <module 'sage' from '/Users/bbarros/Sage-develop/local/lib/python2.7/site-packages/sage/__init__.pyc'> 86 self.loaded.add(module_str) 87 else: 88 return "no load function" 89 90 def unload_extension(self, module_str): 91 """Unload an IPython extension by its module name. 92 93 This function looks up the extension's name in ``sys.modules`` and 94 simply calls ``mod.unload_ipython_extension(self)``. 95 96 Returns the string "no unload function" if the extension doesn't define 97 a function to unload itself, "not loaded" if the extension isn't loaded, 98 otherwise None. 99 """ 100 if module_str not in self.loaded: /Users/bbarros/Sage-develop/local/lib/python2.7/site-packages/IPython/core/extensions.pyc in _call_load_ipython_extension(self=<IPython.core.extensions.ExtensionManager object>, mod=<module 'sage' from '/Users/bbarros/Sage-develop...l/lib/python2.7/site-packages/sage/__init__.pyc'>) 117 """ 118 from IPython.utils.syspathcontext import prepended_to_syspath 119 120 if (module_str in self.loaded) and (module_str in sys.modules): 121 self.unload_extension(module_str) 122 mod = sys.modules[module_str] 123 with prepended_to_syspath(self.ipython_extension_dir): 124 reload(mod) 125 if self._call_load_ipython_extension(mod): 126 self.loaded.add(module_str) 127 else: 128 self.load_extension(module_str) 129 130 def _call_load_ipython_extension(self, mod): 131 if hasattr(mod, 'load_ipython_extension'): --> 132 mod.load_ipython_extension(self.shell) mod.load_ipython_extension = <function load_ipython_extension at 0x104b3e2a8> self.shell = <sage.repl.interpreter.SageTerminalInteractiveShell object at 0x105d7bad0> 133 return True 134 135 def _call_unload_ipython_extension(self, mod): 136 if hasattr(mod, 'unload_ipython_extension'): 137 mod.unload_ipython_extension(self.shell) 138 return True 139 140 def install_extension(self, url, filename=None): 141 """Download and install an IPython extension. 142 143 If filename is given, the file will be so named (inside the extension 144 directory). Otherwise, the name from the URL will be used. The file must 145 have a .py or .zip extension; otherwise, a ValueError will be raised. 146 147 Returns the full path to the installed file. /Users/bbarros/Sage-develop/local/lib/python2.7/site-packages/sage/__init__.pyc in load_ipython_extension(*args=(<sage.repl.interpreter.SageTerminalInteractiveShell object>,)) 1 __all__ = ['all'] 2 3 # Make sure that the correct zlib library is loaded. This is needed 4 # to prevent the system zlib to be loaded instead of the Sage one. 5 # See https://trac.sagemath.org/ticket/23122 6 import zlib 7 8 # IPython calls this when starting up 9 def load_ipython_extension(*args): 10 import sage.repl.ipython_extension ---> 11 sage.repl.ipython_extension.load_ipython_extension(*args) sage.repl.ipython_extension.load_ipython_extension = <function load_ipython_extension at 0x1064a7578> args = (<sage.repl.interpreter.SageTerminalInteractiveShell object at 0x105d7bad0>,) /Users/bbarros/Sage-develop/local/lib/python2.7/site-packages/sage/repl/ipython_extension.pyc in wrapper(*args=(<sage.repl.interpreter.SageTerminalInteractiveShell object>,), **kwargs={}) 546 ....: if work: 547 ....: return 'foo worked' 548 ....: raise RuntimeError("foo didn't work") 549 sage: foo(False) 550 Traceback (most recent call last): 551 ... 552 RuntimeError: foo didn't work 553 sage: foo(True) 554 'foo worked' 555 sage: foo(False) 556 sage: foo(True) 557 """ 558 @wraps(func) 559 def wrapper(*args, **kwargs): 560 if not wrapper.has_run: --> 561 result = func(*args, **kwargs) result = undefined global func = undefined args = (<sage.repl.interpreter.SageTerminalInteractiveShell object at 0x105d7bad0>,) kwargs = {} 562 wrapper.has_run = True 563 return result 564 wrapper.has_run = False 565 return wrapper 566 567 568 @run_once 569 def load_ipython_extension(ip): 570 """ 571 Load the extension in IPython. 572 """ 573 # this modifies ip 574 SageCustomizations(shell=ip) /Users/bbarros/Sage-develop/local/lib/python2.7/site-packages/sage/repl/ipython_extension.pyc in load_ipython_extension(ip=<sage.repl.interpreter.SageTerminalInteractiveShell object>) 559 def wrapper(*args, **kwargs): 560 if not wrapper.has_run: 561 result = func(*args, **kwargs) 562 wrapper.has_run = True 563 return result 564 wrapper.has_run = False 565 return wrapper 566 567 568 @run_once 569 def load_ipython_extension(ip): 570 """ 571 Load the extension in IPython. 572 """ 573 # this modifies ip --> 574 SageCustomizations(shell=ip) global SageCustomizations = <class 'sage.repl.ipython_extension.SageCustomizations'> global shell = undefined ip = <sage.repl.interpreter.SageTerminalInteractiveShell object at 0x105d7bad0> /Users/bbarros/Sage-develop/local/lib/python2.7/site-packages/sage/repl/ipython_extension.pyc in __init__(self=<sage.repl.ipython_extension.SageCustomizations object>, shell=<sage.repl.interpreter.SageTerminalInteractiveShell object>) 417 def __init__(self, shell=None): 418 """ 419 Initialize the Sage plugin. 420 """ 421 self.shell = shell 422 423 self.auto_magics = SageMagics(shell) 424 self.shell.register_magics(self.auto_magics) 425 426 import sage.misc.edit_module as edit_module 427 self.shell.set_hook('editor', edit_module.edit_devel) 428 429 self.init_inspector() 430 self.init_line_transforms() 431 --> 432 import sage.all # until sage's import hell is fixed sage.all = undefined 433 434 self.shell.verbose_quit = True 435 self.set_quit_hook() 436 437 self.register_interface_magics() 438 439 if SAGE_IMPORTALL == 'yes': 440 self.init_environment() 441 442 def register_interface_magics(self): 443 """ 444 Register magics for each of the Sage interfaces 445 """ 446 from sage.repl.interface_magic import InterfaceMagic 447 InterfaceMagic.register_all(self.shell) /Users/bbarros/Sage-develop/local/lib/python2.7/site-packages/sage/all.py in <module>() 123 from sage.crypto.all import * 124 import sage.crypto.mq as mq 125 126 from sage.plot.all import * 127 from sage.plot.plot3d.all import * 128 129 from sage.coding.all import * 130 from sage.combinat.all import * 131 132 from sage.lfunctions.all import * 133 134 from sage.geometry.all import * 135 from sage.geometry.triangulation.all import * 136 from sage.geometry.riemannian_manifolds.all import * 137 --> 138 from sage.dynamics.all import * global sage.dynamics.all = undefined 139 140 from sage.homology.all import * 141 142 from sage.quadratic_forms.all import * 143 144 from sage.games.all import * 145 146 from sage.media.all import * 147 148 from sage.logic.all import * 149 150 from sage.numerical.all import * 151 152 from sage.stats.all import * 153 import sage.stats.all as stats /Users/bbarros/Sage-develop/local/lib/python2.7/site-packages/sage/dynamics/all.py in <module>() 1 from sage.dynamics.interval_exchanges.all import * 2 from sage.dynamics.flat_surfaces.all import * ----> 3 from sage.dynamics.complex_dynamics.all import * global sage.dynamics.complex_dynamics.all = undefined /Users/bbarros/Sage-develop/local/lib/python2.7/site-packages/sage/dynamics/complex_dynamics/all.py in <module>() ----> 1 from sage.dynamics.complex_dynamics.mandel_julia import mandelbrot_plot global sage.dynamics.complex_dynamics.mandel_julia = undefined global mandelbrot_plot = undefined /Users/bbarros/Sage-develop/local/lib/python2.7/site-packages/sage/dynamics/complex_dynamics/mandel_julia.py in <module>() 13 - Ben Barros 14 15 """ 16 17 #***************************************************************************** 18 # Copyright (C) 2017 BEN BARROS <bbar...@slu.edu> 19 # 20 # This program is free software: you can redistribute it and/or modify 21 # it under the terms of the GNU General Public License as published by 22 # the Free Software Foundation, either version 2 of the License, or 23 # (at your option) any later version. 24 # http://www.gnu.org/licenses/ 25 #***************************************************************************** 26 27 from sage.dynamics.complex_dynamics.mandel_julia_helper import fast_mandel_plot ---> 28 from sagenb.notebook.interact import interact global sagenb.notebook.interact = undefined global interact = undefined 29 from sagenb.notebook.interact import slider 30 from sagenb.notebook.interact import input_box 31 32 def mandelbrot_plot(**kwds): 33 r""" 34 Interactive plot of the Mandelbrot set for the map `Q_c(z) = z^2 + c`. 35 36 ALGORITHM: 37 38 Let each pixel in the image be a point `c \in \mathbb{C}` and define the 39 map `Q_c(z) = z^2 + c`. If `|Q_{c}^{k}(c)| > 2` for some `k \geq 0`, it 40 follows that `Q_{c}^{n}(c) \to \infty`. Let `N` be the maximum number of 41 iterations. Compute the first `N` points on the orbit of `0` under `Q_c`. 42 If for any `k < N`, `|Q_{c}^{k}(0)| > 2`, we stop the iteration and assign 43 a color to the point `c` based on how quickly `0` escaped to infinity under /Users/bbarros/Sage-develop/local/lib/python2.7/site-packages/sagenb/__init__.py in <module>() 1 # -*- coding: utf-8 -* 2 # init ----> 3 from . import storage global storage = undefined /Users/bbarros/Sage-develop/local/lib/python2.7/site-packages/sagenb/storage/__init__.py in <module>() 1 # -*- coding: utf-8 -* 2 ----> 3 from .filesystem_storage import FilesystemDatastore global filesystem_storage = undefined global FilesystemDatastore = undefined /Users/bbarros/Sage-develop/local/lib/python2.7/site-packages/sagenb/storage/filesystem_storage.py in <module>() 37 38 """ 39 40 import copy 41 import shutil 42 import tarfile 43 import tempfile 44 import os 45 try: 46 import cPickle as pickle 47 except ImportError: 48 import pickle 49 from six import iteritems 50 51 from .abstract_storage import Datastore ---> 52 from sagenb.misc.misc import set_restrictive_permissions, encoded_str global sagenb.misc.misc = undefined global set_restrictive_permissions = undefined global encoded_str = undefined 53 54 from sage.misc.temporary_file import atomic_write 55 56 def is_safe(a): 57 """ 58 Used when importing contents of various directories from Sage 59 worksheet files. We define this function to avoid the possibility 60 of a user crafting fake sws file such that extracting it creates 61 files outside where we want, e.g., by including .. or / in the 62 path of some file. 63 """ 64 # NOTE: Windows port -- I'm worried about whether a.name will have 65 # / or \ on windows. The code below assume \. 66 return '..' not in a and not a.startswith('/') 67 /Users/bbarros/Sage-develop/local/lib/python2.7/site-packages/sagenb/misc/misc.py in <module>() 191 elif 'DOT_SAGE' in os.environ: 192 DOT_SAGENB = os.environ['DOT_SAGE'] 193 else: 194 DOT_SAGENB = os.path.join(os.environ['HOME'], '.sagenb') 195 196 try: 197 from sage.env import SAGE_URL 198 except ImportError: 199 SAGE_URL = 'http://sagemath.org' 200 201 202 # TODO: Get macros from server and user settings. 203 try: 204 import sage.all 205 from sage.misc.latex_macros import sage_mathjax_macros --> 206 mathjax_macros = sage_mathjax_macros() global mathjax_macros = undefined global sage_mathjax_macros = None 207 except ImportError: 208 mathjax_macros = [ 209 "ZZ : '{\\\\Bold{Z}}'", 210 "RR : '{\\\\Bold{R}}'", 211 "CC : '{\\\\Bold{C}}'", 212 "QQ : '{\\\\Bold{Q}}'", 213 "QQbar : '{\\\\overline{\\\\QQ}}'", 214 "GF : ['{\\\\Bold{F}_{#1}}', 1]", 215 "Zp : ['{\\\\ZZ_{#1}}', 1]", 216 "Qp : ['{\\\\QQ_{#1}}', 1]", 217 "Zmod : ['{\\\\ZZ/#1\\\\ZZ}', 1]", 218 "CIF : '{\\\\Bold{C}}'", 219 "CLF : '{\\\\Bold{C}}'", 220 "RDF : '{\\\\Bold{R}}'", 221 "RIF : '{\\\\Bold{I} \\\\Bold{R}}'", /Users/bbarros/Sage-develop/local/lib/python2.7/site-packages/sage/misc/latex_macros.pyc in sage_mathjax_macros() 190 return [produce_latex_macro(*x) for x in macros] + sage_configurable_latex_macros 191 192 def sage_mathjax_macros(): 193 r""" 194 Return list of MathJax macro definitions for Sage as 195 JavaScript. This feeds each item output by 196 :func:`sage_latex_macros` to 197 :func:`convert_latex_macro_to_mathjax`. 198 199 EXAMPLES:: 200 201 sage: from sage.misc.latex_macros import sage_mathjax_macros 202 sage: sage_mathjax_macros() 203 ['ZZ: "\\\\Bold{Z}"', 'NN: "\\\\Bold{N}"', ... 204 """ --> 205 return [convert_latex_macro_to_mathjax(m) for m in sage_latex_macros()] global convert_latex_macro_to_mathjax = <function convert_latex_macro_to_mathjax at 0x175848758> m = undefined global sage_latex_macros = <function sage_latex_macros at 0x1758487d0> /Users/bbarros/Sage-develop/local/lib/python2.7/site-packages/sage/misc/latex_macros.pyc in sage_latex_macros() 175 sage_configurable_latex_macros = ["\\newcommand{\\Bold}[1]{\\mathbf{#1}}"] 176 177 def sage_latex_macros(): 178 r""" 179 Return list of LaTeX macros for Sage. This just runs the function 180 :func:`produce_latex_macro` on the list ``macros`` defined in this 181 file, and appends ``sage_configurable_latex_macros``. To add a new 182 macro for permanent use in Sage, modify ``macros``. 183 184 EXAMPLES:: 185 186 sage: from sage.misc.latex_macros import sage_latex_macros 187 sage: sage_latex_macros() 188 ['\\newcommand{\\ZZ}{\\Bold{Z}}', '\\newcommand{\\NN}{\\Bold{N}}', ... 189 """ --> 190 return [produce_latex_macro(*x) for x in macros] + sage_configurable_latex_macros global produce_latex_macro = <function produce_latex_macro at 0x1758486e0> x = ['NN'] global macros = [['ZZ'], ['NN'], ['RR'], ['CC'], ['QQ'], ['QQbar'], ['GF', 2], ['Zp', 2], ['Qp', 2], ['Zmod', 2], ['CDF'], ['CIF'], ['CLF'], ['RDF'], ['RIF'], ['RLF'], ['CFF']] global sage_configurable_latex_macros = ['\\newcommand{\\Bold}[1]{\\mathbf{#1}}'] 191 192 def sage_mathjax_macros(): 193 r""" 194 Return list of MathJax macro definitions for Sage as 195 JavaScript. This feeds each item output by 196 :func:`sage_latex_macros` to 197 :func:`convert_latex_macro_to_mathjax`. 198 199 EXAMPLES:: 200 201 sage: from sage.misc.latex_macros import sage_mathjax_macros 202 sage: sage_mathjax_macros() 203 ['ZZ: "\\\\Bold{Z}"', 'NN: "\\\\Bold{N}"', ... 204 """ 205 return [convert_latex_macro_to_mathjax(m) for m in sage_latex_macros()] /Users/bbarros/Sage-develop/local/lib/python2.7/site-packages/sage/misc/latex_macros.pyc in produce_latex_macro(name='NN', *sample_args=()) 83 real_name = names_split[0] 84 else: 85 module, real_name = names_split 86 newcommand = '\\newcommand{\\' + real_name + '}' 87 count = 0 88 args = "(" 89 for x in sample_args: 90 count += 1 91 args += str(x) + ',' 92 args += ')' 93 exec('from ' + module + ' import ' + real_name) 94 if count > 0: 95 defn = '[' + str(count) + ']{' 96 defn += eval('str(LatexCall()(' + real_name + args + '))') + '}' 97 else: ---> 98 defn = '{' + eval('str(LatexCall()(' + real_name + '))') + '}' defn = undefined global eval = undefined real_name = 'NN' 99 count = 0 100 for x in sample_args: 101 count += 1 102 defn = defn.replace(str(x), "#" + str(count)) 103 return newcommand + defn 104 105 def convert_latex_macro_to_mathjax(macro): 106 r""" 107 This converts a LaTeX macro definition (\newcommand...) to a 108 MathJax macro definition (MathJax.Macro...). 109 110 INPUT: 111 112 - ``macro`` - LaTeX macro definition 113 /Users/bbarros/Sage-develop/local/lib/python2.7/site-packages/sage/misc/latex_macros.pyc in <module>() /Users/bbarros/Sage-develop/local/lib/python2.7/site-packages/sage/misc/latex.pyc in __call__(self=<sage.misc.latex.LatexCall instance>, x=UNRECOVERABLE REPR FAILURE, combine_all=False) 914 \left[x, 2\right] 915 916 Check that :trac:`11775` is fixed:: 917 918 sage: latex((x,2), combine_all=True) 919 x 2 920 """ 921 if has_latex_attr(x): 922 return LatexExpr(x._latex_()) 923 try: 924 f = latex_table[type(x)] 925 if isinstance(x, tuple): 926 return LatexExpr(f(x, combine_all=combine_all)) 927 return LatexExpr(f(x)) 928 except KeyError: --> 929 return LatexExpr(str_function(str(x))) global LatexExpr = <class 'sage.misc.latex.LatexExpr'> global str_function = <function str_function at 0x1070706e0> global str = undefined x = undefined 930 931 932 class Latex(LatexCall): 933 r"""nodetex 934 Enter, e.g., 935 936 :: 937 938 %latex 939 The equation $y^2 = x^3 + x$ defines an elliptic curve. 940 We have $2006 = \sage{factor(2006)}$. 941 942 in an input cell in the notebook to get a typeset version. Use 943 ``%latex_debug`` to get debugging output. 944 /Users/bbarros/Sage-develop/src/sage/misc/lazy_import.pyx in sage.misc.lazy_import.LazyImport.__str__ (/Users/bbarros/Sage-develop/src/build/cythonized/sage/misc/lazy_import.c:3695)() 363 sage: lazy_ZZ 364 Integer Ring 365 sage: repr(lazy_ZZ) 366 'Integer Ring' 367 """ 368 return repr(self.get_object()) 369 370 def __str__(self): 371 """ 372 TESTS:: 373 374 sage: lazy_import('sage.all', 'ZZ'); lazy_ZZ = ZZ 375 sage: str(lazy_ZZ) 376 'Integer Ring' 377 """ --> 378 return str(self.get_object()) global str = undefined global self.get_object = undefined 379 380 def __unicode__(self): 381 """ 382 TESTS:: 383 384 sage: lazy_import('sage.all', 'ZZ'); lazy_ZZ = ZZ 385 sage: unicode(lazy_ZZ) 386 u'Integer Ring' 387 """ 388 return unicode(self.get_object()) 389 390 def __nonzero__(self): 391 """ 392 TESTS:: 393 /Users/bbarros/Sage-develop/src/sage/misc/lazy_import.pyx in sage.misc.lazy_import.LazyImport.get_object (/Users/bbarros/Sage-develop/src/build/cythonized/sage/misc/lazy_import.c:2054)() 174 """ 175 self._object = None 176 self._module = module 177 self._name = name 178 self._as_name = name if as_name is None else as_name 179 self._namespace = namespace 180 self._at_startup = at_startup 181 self._deprecation = deprecation 182 183 cdef inline get_object(self): 184 """ 185 Faster, Cython-only partially-inlined version of ``_get_object``. 186 """ 187 if likely(self._object is not None): 188 return self._object --> 189 return self._get_object() global self._get_object = undefined 190 191 cpdef _get_object(self): 192 """ 193 Return the wrapped object, importing it if necessary. 194 195 OUTPUT: 196 197 - the wrapped object 198 199 EXAMPLES:: 200 201 sage: from sage.misc.lazy_import import LazyImport 202 sage: my_integer_ring = LazyImport('sage.rings.all', 'ZZ') 203 sage: my_integer_ring._object is None 204 True /Users/bbarros/Sage-develop/src/sage/misc/lazy_import.pyx in sage.misc.lazy_import.LazyImport._get_object (/Users/bbarros/Sage-develop/src/build/cythonized/sage/misc/lazy_import.c:2201)() 203 sage: my_integer_ring._object is None 204 True 205 sage: my_integer_ring._get_object() 206 Integer Ring 207 sage: my_integer_ring._object is None 208 False 209 sage: my_integer_ring = LazyImport('sage.rings.all', 'ZZ', at_startup=True) 210 sage: my_integer_ring 211 Option ``at_startup=True`` for lazy import ZZ not needed anymore 212 Integer Ring 213 """ 214 if self._object is not None: 215 return self._object 216 217 if startup_guard and not self._at_startup: --> 218 raise RuntimeError(f"resolving lazy import {self._name} during startup") global RuntimeError = undefined global f = undefined 219 elif self._at_startup and not startup_guard: 220 print('Option ``at_startup=True`` for lazy import {0} not needed anymore'.format(self._name)) 221 self._object = getattr(__import__(self._module, {}, {}, [self._name]), self._name) 222 name = self._as_name 223 if self._deprecation is not None: 224 from sage.misc.superseded import deprecation 225 try: 226 trac_number, message = self._deprecation 227 except TypeError: 228 trac_number = self._deprecation 229 message = ('\nImporting {name} from here is deprecated. ' + 230 'If you need to use it, please import it directly from' + 231 ' {module_name}').format(name=name, module_name=self._module) 232 deprecation(trac_number, message) 233 # Replace the lazy import in the namespace by the actual object RuntimeError: resolving lazy import NN during startup *************************************************************************** History of session input: *** Last line of input (may not be in above history):