Skip to content

Commit c082cef

Browse files
committed
Properly raise DeprecationWarning
1 parent 2565a0a commit c082cef

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

mbuild/utils/io.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
from pkg_resources import resource_filename
2424
import sys
2525
import textwrap
26+
import warnings
2627
from unittest import SkipTest
2728

2829

@@ -114,8 +115,9 @@ def import_(module):
114115
pass
115116
try:
116117
pybel = importlib.import_module('pybel')
117-
raise DeprecationWarning('openbabel 2.0 detected and will be '
118-
'dropped in a future release. Consider upgrading to 3.x.')
118+
msg = ('openbabel 2.0 detected and will be dropped in a future '
119+
'release. Consider upgrading to 3.x.')
120+
warnings.warn(msg, DeprecationWarning)
119121
return pybel
120122
except ModuleNotFoundError:
121123
pass

0 commit comments

Comments
 (0)