Mercurial > public > mercurial-scm > hg
changeset 52683:3c6460c0586f
hghave: avoid unused import warning by deleting the imported module
PyCharm was complaining about that the previous code was a statement with no
effect. This avoids that warning, and hopefully also appeases whatever linter
was complaining about an unused import.
author | Matt Harbison <matt_harbison@yahoo.com> |
---|---|
date | Tue, 14 Jan 2025 07:31:38 +0100 |
parents | 1f76fd3e9f7f |
children | 9ec635cc0a29 |
files | tests/hghave.py |
diffstat | 1 files changed, 13 insertions(+), 13 deletions(-) [+] |
line wrap: on
line diff
--- a/tests/hghave.py Sun Jan 12 20:05:25 2025 -0500 +++ b/tests/hghave.py Tue Jan 14 07:31:38 2025 +0100 @@ -175,7 +175,7 @@ import breezy.revision import breezy.revisionspec - breezy.revisionspec.RevisionSpec + del breezy.revisionspec if breezy.__doc__ is None or breezy.version_info[:2] < (3, 1): return False except (AttributeError, ImportError): @@ -340,7 +340,7 @@ try: import _lsprof - _lsprof.Profiler # silence unused import warning + del _lsprof # silence unused import warning return True except ImportError: return False @@ -427,7 +427,7 @@ try: import pygit2 - pygit2.Oid # silence unused import + del pygit2 # silence unused import return True except ImportError: return False @@ -456,7 +456,7 @@ try: import docutils.core - docutils.core.publish_cmdline # silence unused import + del docutils.core # silence unused import return True except ImportError: return False @@ -648,7 +648,7 @@ try: import pygments - pygments.highlight # silence unused import warning + del pygments # silence unused import warning return True except ImportError: return False @@ -683,7 +683,7 @@ try: import ssl - ssl.CERT_NONE + del ssl return True except ImportError: return False @@ -769,7 +769,7 @@ try: import curses - curses.COLOR_BLUE + del curses # Windows doesn't have a `tic` executable, but the windows_curses # package is sufficient to run the tests without it. @@ -931,7 +931,7 @@ try: import hypothesis - hypothesis.given + del hypothesis return True except ImportError: return False @@ -947,7 +947,7 @@ try: import mercurial.zstd - mercurial.zstd.__version__ + del mercurial.zstd return True except ImportError: return False @@ -963,7 +963,7 @@ try: import ensurepip - ensurepip.bootstrap + del ensurepip return True except ImportError: return False @@ -992,7 +992,7 @@ try: import fuzzywuzzy - fuzzywuzzy.__version__ + del fuzzywuzzy return True except ImportError: return False @@ -1116,7 +1116,7 @@ try: import vcr - vcr.VCR + del vcr return True except (ImportError, AttributeError): pass @@ -1186,7 +1186,7 @@ try: import _lzma - _lzma.FORMAT_XZ + del _lzma return True except ImportError: return False