Ticket #6518: trac_6518-doctest_warning.patch

File trac_6518-doctest_warning.patch, 906 bytes (added by burcin, 13 years ago)

patch for the scripts repository

  • sage-doctest

    # HG changeset patch
    # User Burcin Erocal <burcin@erocal.org>
    # Date 1247401205 -7200
    # Node ID 8c3b784a50d455d5a83a8ef3e880456410f635c0
    # Parent  72e3e280cab28982db1d5d426dcf5e822bf0c089
    Make the show_warning() function defined in sage-doctest use the new call signature from Python 2.6.
    
    diff --git a/sage-doctest b/sage-doctest
    a b  
    386386def warning_function(f):
    387387    import warnings
    388388
    389     def doctest_showwarning(message, category, filename, lineno, file=f):
     389    def doctest_showwarning(message, category, filename, lineno, file=f, line=None):
    390390        try:
    391             file.write(warnings.formatwarning(message, category, 'doctest', lineno))
     391            file.write(warnings.formatwarning(message, category, 'doctest', lineno, line))
    392392        except IOError:
    393393            pass # the file (probably stdout) is invalid
    394394    return doctest_showwarning