Skip to content

Commit

Permalink
docs: mentioned pull #1388
Browse files Browse the repository at this point in the history
  • Loading branch information
nedbat committed May 30, 2022
1 parent f40da64 commit 73f4a67
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
7 changes: 4 additions & 3 deletions CHANGES.rst
Expand Up @@ -21,11 +21,12 @@ Unreleased
----------

- Greatly improved performance on PyPy, and other environments that need the
pure Python trace function. Thanks, `Carl Friedrich Bolz-Tereick
<pull 1381_>`_. Slightly improved performance when using the C trace
function, as most environments do.
pure Python trace function. Thanks, Carl Friedrich Bolz-Tereick (`pull
1381`_ and `pull 1388`_). Slightly improved performance when using the C
trace function, as most environments do.

.. _pull 1381: https://github.com/nedbat/coveragepy/pull/1381
.. _pull 1388: https://github.com/nedbat/coveragepy/pull/1388


.. _changes_64:
Expand Down
7 changes: 3 additions & 4 deletions coverage/pytracer.py
Expand Up @@ -67,11 +67,10 @@ def __init__(self):
# On exit, self.in_atexit = True
atexit.register(setattr, self, 'in_atexit', True)

# cache a bound method on the instance, so that we don't have to
# re-create a bound method object all the time
# Cache a bound method on the instance, so that we don't have to
# re-create a bound method object all the time.
self._cached_bound_method_trace = self._trace


def __repr__(self):
return "<PyTracer at 0x{:x}: {} lines in {} files>".format(
id(self),
Expand Down Expand Up @@ -289,7 +288,7 @@ def stop(self):
dont_warn = (env.PYPY and env.PYPYVERSION >= (5, 4) and self.in_atexit and tf is None)
if (not dont_warn) and tf != self._cached_bound_method_trace: # pylint: disable=comparison-with-callable
self.warn(
f"Trace function changed, data is likely wrong: "
"Trace function changed, data is likely wrong: " +
f"{tf!r} != {self._cached_bound_method_trace!r}",
slug="trace-changed",
)
Expand Down

0 comments on commit 73f4a67

Please sign in to comment.