Ticket #11885: trac_11885.patch

File trac_11885.patch, 741 bytes (added by benjaminfjones, 11 years ago)

adds check that parent has attribute 'prec' before calling

  • sage/libs/mpmath/utils.pyx

    # HG changeset patch
    # User Benjamin Jones <benjaminfjones@gmail.com>
    # Date 1317408128 18000
    # Node ID ab2f815a5ba084f8c529639bf969e40e9172a722
    # Parent  dab05d11355c2e8e4c8550fcb87a0c94194920ba
    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  
    412412    prec = kwargs.pop('prec', orig)
    413413    parent = kwargs.pop('parent', None)
    414414    if parent is not None:
    415         prec = parent.prec()
     415        if hasattr(parent, 'prec'):
     416            prec = parent.prec()
    416417    prec2 = prec + 20
    417418    args = sage_to_mpmath(args, prec2)
    418419    kwargs = sage_to_mpmath(kwargs, prec2)