From 0abbfe43d9de838323976f8af6eb98d0f0f670d7 Mon Sep 17 00:00:00 2001 From: Mathieu Kniewallner Date: Sun, 1 Oct 2023 13:42:28 +0200 Subject: [PATCH] refactor: remove `importlib-metadata` fallback Python 3.7 support has been removed in https://github.com/PyCQA/bandit/pull/1034, so the `importlib-metadata` fallback, is no longer required, as it was only need for Python < 3.8. --- bandit/__init__.py | 5 +---- requirements.txt | 1 - 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/bandit/__init__.py b/bandit/__init__.py index ebaacceef..75f863db2 100644 --- a/bandit/__init__.py +++ b/bandit/__init__.py @@ -2,10 +2,7 @@ # Copyright 2014 Hewlett-Packard Development Company, L.P. # # SPDX-License-Identifier: Apache-2.0 -try: - from importlib import metadata -except ImportError: - import importlib_metadata as metadata +from importlib import metadata from bandit.core import config # noqa from bandit.core import context # noqa diff --git a/requirements.txt b/requirements.txt index 3db71252d..289782022 100644 --- a/requirements.txt +++ b/requirements.txt @@ -6,4 +6,3 @@ PyYAML>=5.3.1 # MIT stevedore>=1.20.0 # Apache-2.0 colorama>=0.3.9;platform_system=="Windows" # BSD License (3 clause) rich # MIT -importlib-metadata;python_version<"3.8" # Apache-2.0