Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 0c654ca

Browse files
committed
turn on warning filter to print deprecation warning by default
1 parent 9d29ac1 commit 0c654ca

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

kubernetes/client/apis/__init__.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,10 @@
55

66
# alias kubernetes.client.api package and print deprecation warning
77
from kubernetes.client.api import *
8-
warnings.warn(
9-
"The package kubernetes.client.apis is renamed and deprecated, use kubernetes.client.api instead (please note that the trailing s was removed).",
10-
DeprecationWarning
11-
)
8+
9+
with warnings.catch_warnings():
10+
warnings.simplefilter('default')
11+
warnings.warn(
12+
"The package kubernetes.client.apis is renamed and deprecated, use kubernetes.client.api instead (please note that the trailing s was removed).",
13+
DeprecationWarning
14+
)

0 commit comments

Comments
 (0)