Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
r1231 committed - check BACKEND in ctx_mp instead of using try/except ImportError...
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  1 message - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
mpm...@googlecode.com  
View profile  
 More options Feb 27 2011, 2:05 pm
From: mpm...@googlecode.com
Date: Sun, 27 Feb 2011 19:05:49 +0000
Local: Sun, Feb 27 2011 2:05 pm
Subject: [mpmath] r1231 committed - check BACKEND in ctx_mp instead of using try/except ImportError...
Revision: 1231
Author: fredrik.johansson
Date: Sun Feb 27 11:04:46 2011
Log: check BACKEND in ctx_mp instead of using try/except ImportError

This should allow mpmath to optionally function in non-sage mode on systems  
where sage is available.
http://code.google.com/p/mpmath/source/detail?r=1231

Modified:
  /trunk/mpmath/ctx_mp.py

=======================================
--- /trunk/mpmath/ctx_mp.py     Fri Jan 28 12:37:56 2011
+++ /trunk/mpmath/ctx_mp.py     Sun Feb 27 11:04:46 2011
@@ -8,7 +8,7 @@

  from .ctx_base import StandardBaseContext

-from .libmp.backend import basestring
+from .libmp.backend import basestring, BACKEND

  from . import libmp

@@ -43,12 +43,11 @@
  get_complex = re.compile(r'^\(?(?P<re>[\+\-]?\d*\.?\d*(e[\+\-]?\d+)?)??'
                           r'(?P<im>[\+\-]?\d*\.?\d*(e[\+\-]?\d+)?j)?\)?$')

-
-try:
+if BACKEND == 'sage':
      from sage.libs.mpmath.ext_main import Context as BaseMPContext
      # pickle hack
      import sage.libs.mpmath.ext_main as _mpf_module
-except ImportError:
+else:
      from .ctx_mp_python import PythonMPContext as BaseMPContext
      from . import ctx_mp_python as _mpf_module


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »