From cd65e2c1b5eb659a4406a03a8305a84a0674ba85 Mon Sep 17 00:00:00 2001 From: Peace-Maker Date: Wed, 18 Dec 2024 02:07:34 +0100 Subject: [PATCH] Only apply platform patch on Python 3 --- docs/source/conf.py | 6 +++--- pwnlib/util/misc.py | 2 -- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/docs/source/conf.py b/docs/source/conf.py index 2466613f6..4c42e8cef 100755 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -471,13 +471,13 @@ def py2_doctest_init(self, checker=None, verbose=None, optionflags=0): doctest.DocTestRunner.__init__(self, checker, verbose, optionflags) if 'doctest' in sys.argv: - def setup(app): - app.add_builder(PlatformDocTestBuilder, override=True) - # app.connect('autodoc-skip-member', dont_skip_any_doctests) if sys.version_info[:1] < (3,): sphinx.ext.doctest.SphinxDocTestRunner.__init__ = py2_doctest_init else: + def setup(app): + app.add_builder(PlatformDocTestBuilder, override=True) + # app.connect('autodoc-skip-member', dont_skip_any_doctests) # monkey patching paramiko due to https://github.com/paramiko/paramiko/pull/1661 import paramiko.client import binascii diff --git a/pwnlib/util/misc.py b/pwnlib/util/misc.py index d0fe8639f..75790c596 100644 --- a/pwnlib/util/misc.py +++ b/pwnlib/util/misc.py @@ -165,8 +165,6 @@ def which(name, all = False, path=None): >>> which('sh') # doctest: +ELLIPSIS +LINUX '.../bin/sh' - >>> which('cmd') # doctest: +ELLIPSIS +WINDOWS - '...\\cmd.EXE' """ # If name is a path, do not attempt to resolve it. if os.path.sep in name: