[Updated] D11921: pytype: stop excluding statprof.py

mharbison72 (Matt Harbison) phabricator at mercurial-scm.org
Fri Dec 17 11:11:27 UTC 2021


Closed by commit rHGd2fff292c265: pytype: stop excluding statprof.py (authored by mharbison72).
This revision was automatically updated to reflect the committed changes.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D11921?vs=31478&id=31516

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D11921/new/

REVISION DETAIL
  https://phab.mercurial-scm.org/D11921

AFFECTED FILES
  mercurial/statprof.py
  tests/test-check-pytype.t

CHANGE DETAILS

diff --git a/tests/test-check-pytype.t b/tests/test-check-pytype.t
--- a/tests/test-check-pytype.t
+++ b/tests/test-check-pytype.t
@@ -32,7 +32,6 @@
 mercurial/pycompat.py         # bytes vs str issues
 mercurial/repoview.py         # [attribute-error]
 mercurial/sslutil.py          # [attribute-error]
-mercurial/statprof.py         # bytes vs str on TextIO.write() [wrong-arg-types]
 mercurial/testing/storage.py  # tons of [attribute-error]
 mercurial/ui.py               # [attribute-error], [wrong-arg-types]
 mercurial/unionrepo.py        # ui, svfs, unfiltered [attribute-error]
@@ -72,7 +71,6 @@
   >    -x mercurial/pycompat.py \
   >    -x mercurial/repoview.py \
   >    -x mercurial/sslutil.py \
-  >    -x mercurial/statprof.py \
   >    -x mercurial/testing/storage.py \
   >    -x mercurial/thirdparty \
   >    -x mercurial/ui.py \
diff --git a/mercurial/statprof.py b/mercurial/statprof.py
--- a/mercurial/statprof.py
+++ b/mercurial/statprof.py
@@ -494,9 +494,9 @@
         data = state
 
     if fp is None:
-        import sys
+        from .utils import procutil
 
-        fp = sys.stdout
+        fp = procutil.stdout
     if len(data.samples) == 0:
         fp.write(b'No samples recorded.\n')
         return



To: mharbison72, #hg-reviewers, Alphare
Cc: Alphare, mercurial-patches
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mercurial-scm.org/pipermail/mercurial-patches/attachments/20211217/41ec8916/attachment-0002.html>


More information about the Mercurial-patches mailing list