title: Check if return value is instance of Py_None
body: <p>I have to use a <a href="/questions/tagged/c" class="post-tag" title="show questions tagged &#39;c&#39;" rel="tag">c</a> function (<code>myAPI.readArr</code>) that returns a scalar,<code>numpy.ndarray</code> or <code>Py_None</code> on failure. </p>
  
  <p>This works for a failure:</p>
  
  <pre><code>data = myAPI.readArr(arg1, arg2)
  if not data:
     raise Exception("Problem!")
  </code></pre>
  
  <p>but for valid arguments I get:</p>
  
  <pre><code>ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()
  </code></pre>
  
  <p>How can I check that the call succeeded or not?</p>