Skip to content

Commit

Permalink
src/sage/doctest/util.py: fix _pid_cpu_seconds doctest on macOS
Browse files Browse the repository at this point in the history
In doctests, cputime = 0.0 gets preparsed into a RealLiteral causing
isinstance(cputime, float) to return False.
  • Loading branch information
orlitzky committed Oct 12, 2024
1 parent ec866e0 commit 711abfa
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/sage/doctest/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ def _pid_cpu_seconds(self, pid):
nonnegative float or raise an ``OSError``::
sage: from sage.doctest.util import Timer
sage: cputime = 0.0
sage: cputime = float(0.0)
sage: try:
....: cputime = Timer()._pid_cpu_seconds(1)
....: except OSError:
Expand Down

0 comments on commit 711abfa

Please sign in to comment.