diff options
Diffstat (limited to 'sagemath-ignore-warnings.patch')
-rw-r--r-- | sagemath-ignore-warnings.patch | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/sagemath-ignore-warnings.patch b/sagemath-ignore-warnings.patch new file mode 100644 index 000000000000..c1094d844bc5 --- /dev/null +++ b/sagemath-ignore-warnings.patch @@ -0,0 +1,25 @@ +Description: Ignore warnings of PARI increasing the stack size when parsing doctests + Since we can't patch PARI to not produce the warnings and we don't want to + patch tons of doctests to expect the warnings, we patch the doctest parser + to ignore them. +Author: Tobias Hansen <thansen@debian.org> +--- sage/src/sage/doctest/parsing.py ++++ sage/src/sage/doctest/parsing.py +@@ -40,6 +40,8 @@ + + float_regex = re.compile('\s*([+-]?\s*((\d*\.?\d+)|(\d+\.?))([eE][+-]?\d+)?)') + optional_regex = re.compile(r'(py2|py3|long time|not implemented|not tested|known bug)|([^ a-z]\s*optional\s*[:-]*((\s|\w)*))') ++pari_stack_warning_regex = re.compile(r'\s*\*\*\*.*(Warning: increasing stack size to )\d+\.') ++glpk_simplex_warning_regex = re.compile(r'(Long-step dual simplex will be used)') + find_sage_prompt = re.compile(r"^(\s*)sage: ", re.M) + find_sage_continuation = re.compile(r"^(\s*)\.\.\.\.:", re.M) + random_marker = re.compile('.*random', re.I) +@@ -935,6 +936,8 @@ + <type 'float'> + """ + got = self.human_readable_escape_sequences(got) ++ got = pari_stack_warning_regex.sub('', got) ++ got = glpk_simplex_warning_regex.sub('', got) + if isinstance(want, MarkedOutput): + if want.random: + return True |