Gar*_*ary 15
我做了自己的研究,与@doctorlove所说的相似
numpy.seterr(all='raise')
Run Code Online (Sandbox Code Playgroud)
然后numpy将引发异常而不是RuntimeWarnings.然后可以通过PyCharm捕获异常.
小智 5
您可以使用警告模块将警告转换为错误,然后尝试除外并设置断点:
import warnings
warnings.simplefilter('error')
try:
#code that generates warning
except:
#put a breakpoint here
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
3132 次 |
| 最近记录: |