title: AttributeError: __enter__ error when trying to query from MySQL
body: <p>The following used to worked for me.
  For some reason it is not anymore.</p>
  <pre><code>&gt;&gt;&gt; import configparser
  &gt;&gt;&gt; from mysql.connector import connect, Error
  &gt;&gt;&gt; with open('file.cfg', 'r') as f:
  ...     config_string = '[s]\n' + f.read()
  ...
  &gt;&gt;&gt; config = configparser.ConfigParser()
  &gt;&gt;&gt; config.read_string(config_string)
  &gt;&gt;&gt; with connect(host=config.get('s','HOST'),user=config.get('s','USER'),password=config.get('s','PASS'),database=&quot;db&quot;) as connection:
  ...     with connection.cursor() as cursor:
  ...             cursor.execute(&quot;select dt from tab limit 1&quot;)
  ...
  Traceback (most recent call last):
    File &quot;&lt;stdin&gt;&quot;, line 1, in &lt;module&gt;
  AttributeError: __enter__
  &gt;&gt;&gt;
  </code></pre>
  <p>mysql_connector-2.2.9-cp37-cp37m-linux_x86_64.whl</p>
  <p>Python 3.7.6 (default, Feb 26 2020, 20:54:15)</p>