title: TypeError: 'NoneType' object has no attribute '__getitem__' whereas cur.fetchone is not None
body: <p>I have the following code :</p>
  
  <pre><code>cur1.execute("SELECT * FROM consommation WHERE zone=? AND date=?",(zone,date_p))
  if cur1.fetchone() is not None:
      abcisses+=(cur1.fetchone()[0][11:13]+'h',)
  </code></pre>
  
  <p>but when I run it I have an error : <code>TypeError: 'NoneType' object has no attribute '__getitem__'</code>, whereas cur1.fetchone is not empty. So I don’t understand why it doesn’t work. Is there someone who know why ?</p>