title: Does import order matter?
body: <p>I have been running a code that receives data from a server using <code>websockets</code>, and stores the received data to a <code>MySQL</code> server with <code>mysql-connector-python</code>. It has been running successfully so far, but I recently encountered an <code>ssl.SSLCertVerificationError</code> for some reason.</p>
  <p>After breaking the code into small pieces, I found that the order of importing <code>asyncio</code> and <code>mysql-connector-python</code> matters, but I'm still not sure why it does. So far, I have known that each module is self-contained, hence the import order would not matter in any cases, but it doesn't seem true.</p>
  <p>Please help me understand why this happens, and if possible, share a method to debug this kind of problems.</p>
  <ul>
  <li>Platform: Ubuntu 20.04.3 LTS</li>
  <li>Python: Python 3.8.10</li>
  <li>mysql-connector-python: 8.0.28</li>
  <li>websockets: 10.1</li>
  </ul>
  <p>It runs without an error when I import <code>asyncio</code> in advance of <code>mysql</code>.</p>
  <pre><code>import asyncio
  
  from mysql.connector import pooling
  import websockets
  
  class Worker:
      def __init__(self):
          asyncio.run(self.connect())
  
      async def connect(self):
          async with websockets.connect(&quot;wss://localhost:8765&quot;) as websocket:
              print(&quot;Hello!&quot;)
  
  worker = Worker()
  </code></pre>
  <p>However, the code that follows results in <code>ssl.SSLCertVerificationError</code>.</p>
  <pre><code>from mysql.connector import pooling
  import websockets
  
  import asyncio
  
  class Worker:
      def __init__(self):
          asyncio.run(self.connect())
  
      async def connect(self):
          async with websockets.connect(&quot;wss://localhost:8765&quot;) as websocket:
              print(&quot;Hello!&quot;)
  
  worker = Worker()
  </code></pre>