title: decimal.InvalidOperation in python
body: <p>I was testing my code and I thought that this piece of code was correct:</p>
  
  <pre><code>while True:
      try:
          p = Decimal(raw_input(...))
          if ...condition... : break
          else: raise ValueError
      except ValueError:
          print "Error! ..."
  </code></pre>
  
  <p>but it's not, since when I input "a", this is what I get:</p>
  
  <pre><code>File "multiple.py", line 28, in &lt;module&gt;
    precision = Decimal(raw_input(...))
  File "/usr/lib/python2.7/decimal.py", line 548, in __new__
    "Invalid literal for Decimal: %r" % value)
  File "/usr/lib/python2.7/decimal.py", line 3872, in _raise_error
    raise error(explanation)
  decimal.InvalidOperation: Invalid literal for Decimal: 'a'
  </code></pre>
  
  <p>ValueError does not catch InvalidOperation.
  I don't want the program to stop because of that, I want it to keep asking for input until it satisfies the condition. How do I do it?</p>