title: How to suppress a third-party warning using warnings.filterwarnings
body: <p>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:</p>
  
  <pre><code>C:\Python26\lib\site-packages\Crypto\Util\randpool.py:40: RandomPool_Deprecation
  Warning: This application uses RandomPool, which is BROKEN in older releases.  S
  ee http://www.pycrypto.org/randpool-broken
    RandomPool_DeprecationWarning)
  </code></pre>
  
  <p>I know that this has to do with the fact that Paramiko is using some Deprecated functionalities of PyCrypto. </p>
  
  <p>My question is, is there a way to suppress this warning programmatically ?
  I have tried this:</p>
  
  <pre><code>warnings.filterwarnings(action='ignore', \
  category=DeprecationWarning, module='paramiko')
  </code></pre>
  
  <p>and even this:</p>
  
  <pre><code>warnings.filterwarnings(action='ignore', \
  category=DeprecationWarning, module='randpool')
  </code></pre>
  
  <p>before 'import paramiko' statement and before paramiko-specific function calls, but nothing works. This warning keeps showing up no matter what.
  If it helps, here's the code in the third party library that prints the warning:</p>
  
  <p>in randpool.py:</p>
  
  <pre><code>from Crypto.pct_warnings import RandomPool_DeprecationWarning
  import Crypto.Random
  import warnings
  
  class RandomPool:
      """Deprecated.  Use Random.new() instead.
  
      See http://www.pycrypto.org/randpool-broken
      """
      def __init__(self, numbytes = 160, cipher=None, hash=None, file=None):
          warnings.warn("This application uses RandomPool, which is BROKEN in older releases.  See http://www.pycrypto.org/randpool-broken",
              RandomPool_DeprecationWarning)
  </code></pre>
  
  <p>If you know a way around this, please help me shut this warning off.</p>