Skip to content

Commit 1bcfec3

Browse files
correctly emit warning
1 parent 7d50bcd commit 1bcfec3

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

linkml_runtime/utils/schemaview.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
from collections import defaultdict, deque
88
from pathlib import Path
99
from typing import Mapping, Tuple
10+
import warnings
1011

1112
from linkml_runtime.utils.namespaces import Namespaces
1213
from deprecated.classic import deprecated
@@ -222,7 +223,10 @@ def imports_closure(self, imports: bool = True, traverse: Optional[bool] = None,
222223
todo = [self.schema.name]
223224

224225
if traverse is not None:
225-
DeprecationWarning('traverse behaves identically to imports and will be removed in a future version. Use imports instead.')
226+
warnings.warn(
227+
'traverse behaves identically to imports and will be removed in a future version. Use imports instead.',
228+
DeprecationWarning
229+
)
226230

227231
if not imports or (not traverse and traverse is not None):
228232
return todo

0 commit comments

Comments
 (0)