How to suppress a third-party warning using warnings.filterwarnings

前端 未结 4 2039
忘了有多久
忘了有多久 2021-02-05 00:55

I am using Paramiko in my python code (for sftp). Everything works fine except that everytime I import or call a paramiko function. This warning would show up:

C         


        
4条回答
  •  不思量自难忘°
    2021-02-05 01:23

    Easiest way would be as the warnings module suggests here:

    with warnings.catch_warnings():
        warnings.simplefilter("ignore")
        import paramiko
    

提交回复
热议问题