smbserver: check impacket presence differently

To silence ruff and GitHub CodeQL warnings.

Closes #21929
This commit is contained in:
Viktor Szakats 2026-06-09 12:58:24 +02:00
parent 056dcd9e71
commit cb4b3e75e8
No known key found for this signature in database

View file

@ -25,6 +25,7 @@
import argparse
import configparser
import importlib.util
import logging
import os
import signal
@ -36,9 +37,7 @@ import threading
from util import ClosingFileHandler, TestData
# impacket needs to be installed in the Python environment
try:
import impacket # noqa: F401
except ImportError:
if importlib.util.find_spec('impacket') is None:
sys.stderr.write(
'Warning: Python package impacket is required for smb testing; '
'use pip or your package manager to install it\n')