Skip to content

Commit d490cdf

Browse files
authored
silance "is" with 'str' literal syntax warning from pretrainedmodels in python >= 3.12 (#987)
1 parent 441a602 commit d490cdf

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

segmentation_models_pytorch/__init__.py

+1
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626

2727
# Suppress the specific SyntaxWarning for `pretrainedmodels`
2828
warnings.filterwarnings("ignore", message="is with a literal", category=SyntaxWarning)
29+
warnings.filterwarnings("ignore", message=r'"is" with \'str\' literal.*', category=SyntaxWarning) # for python >= 3.12
2930

3031

3132
def create_model(

0 commit comments

Comments
 (0)