# HG changeset patch
# User Benjamin Jones <benjaminfjones@gmail.com>
# Date 1317408128 18000
# Node ID fb5d9ee43142c5fba6351abfbeefa6c9194c7396
# Parent b1a099f40be3f25088294fdcb19612508d97b404
Trac 11885: added check that parent has attribute 'prec' before calling it
diff --git a/sage/libs/mpmath/utils.pyx b/sage/libs/mpmath/utils.pyx
a
|
b
|
|
406 | 406 | sage: type(_) |
407 | 407 | <type 'sage.rings.real_double.RealDoubleElement'> |
408 | 408 | |
| 409 | Check that Trac 11885 is fixed:: |
| 410 | |
| 411 | sage: a.call(a.ei, 1.0r, parent=float) |
| 412 | 1.8951178163559366 |
| 413 | |
409 | 414 | """ |
410 | 415 | from mpmath import mp |
411 | 416 | orig = mp.prec |
412 | 417 | prec = kwargs.pop('prec', orig) |
413 | 418 | parent = kwargs.pop('parent', None) |
414 | 419 | if parent is not None: |
415 | | prec = parent.prec() |
| 420 | try: |
| 421 | prec = parent.prec() |
| 422 | except AttributeError: |
| 423 | pass |
416 | 424 | prec2 = prec + 20 |
417 | 425 | args = sage_to_mpmath(args, prec2) |
418 | 426 | kwargs = sage_to_mpmath(kwargs, prec2) |