How is this "referenced before assignment"?
<p>I have a bit of Python to connect to a database with a switch throw in for local versus live. </p>

<pre><code>    LOCAL_CONNECTION = {"server": "127.0.0.1", "user": "root", "password": "", "database": "testing"}
 LIVE_CONNECTION = {"server": "10.1.1.1", "user": "x", "password": "y", "database": "nottesting"}

 if debug_mode:
  connection_info = LOCAL_CONNECTION
 else:
  connnection_info = LIVE_CONNECTION
 self.connection = MySQLdb.connect(host = connection_info["server"], user = connection_info["user"], passwd = connection_info["password"], db = connection_info["database"])
</code></pre>

<p>Works fine locally (Windows, Python 2.5) but live (Linux, Python 2.4) I'm getting:</p>

<pre><code>UnboundLocalError: local variable 'connection_info' referenced before assignment
</code></pre>

<p>I see the same error even if I remove the if/ else and just assign connection info directly to the LIVE_CONNECTION value. If I hard-code the live connection values into the last line, it all works. Clearly I'm sleepy. What am I not seeing? </p>
