如何在python中强制显示弃用警告消息?

时间:2021-01-04 20:11:03

标签: python-2.7 deprecation-warning

我在我的 api 中使用了 warnings.warn(message, DeprecationWarning, stacklevel=2),但我刚刚了解到除非由 __main__ 中的代码触发,否则这将被忽略。

而且我的 api 被很多地方调用。

0 个答案:

没有答案