MilesCranmer commited on
Commit
397b012
1 Parent(s): e9c2b70

Fix import error not giving traceback

Browse files
Files changed (1) hide show
  1. pysr/julia_helpers.py +2 -4
pysr/julia_helpers.py CHANGED
@@ -95,14 +95,12 @@ def install(julia_project=None, quiet=False): # pragma: no cover
95
 
96
 
97
  def _import_error():
98
- raise ImportError(
99
- """
100
  Required dependencies are not installed or built. Run the following code in the Python REPL:
101
 
102
  >>> import pysr
103
  >>> pysr.install()
104
  """
105
- )
106
 
107
 
108
  def _process_julia_project(julia_project):
@@ -167,7 +165,7 @@ def init_julia(julia_project=None, quiet=False):
167
  )
168
 
169
  if not info.is_pycall_built():
170
- _import_error()
171
 
172
  Main = None
173
  try:
 
95
 
96
 
97
  def _import_error():
98
+ return """
 
99
  Required dependencies are not installed or built. Run the following code in the Python REPL:
100
 
101
  >>> import pysr
102
  >>> pysr.install()
103
  """
 
104
 
105
 
106
  def _process_julia_project(julia_project):
 
165
  )
166
 
167
  if not info.is_pycall_built():
168
+ raise ImportError(_import_error())
169
 
170
  Main = None
171
  try: