Skip to content

Commit 6b44798

Browse files
authored
Refactor warning handling for blackduck import (DefectDojo#13229)
* Refactor warning handling for blackduck import Correcting an incorrect scope assignment of the warnings class DefectDojo#13225 (comment) * Update dojo/tools/api_blackduck/api_client.py * Update dojo/tools/api_blackduck/api_client.py
1 parent 488a2e4 commit 6b44798

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

dojo/tools/api_blackduck/api_client.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,9 @@
22

33
# Ignore DeprecationWarning from the blackduck library because we cannot do anything about it
44
# until they fix it in their library
5-
warnings.filterwarnings("ignore", category=DeprecationWarning)
6-
from blackduck import Client # noqa: E402
5+
# TODO: Corrects https://github.com/DefectDojo/django-DefectDojo/issues/13218 in the short term
6+
with warnings.catch_warnings(action="ignore", category=DeprecationWarning):
7+
from blackduck import Client
78

89

910
class BlackduckAPI:

0 commit comments

Comments
 (0)