[Sqlalchemy-commits] [5993] sqlalchemy/branches/rel_0_6: squeezing out py3k fixes.... sooo slowwww
Brought to you by:
zzzeek
From: <co...@sq...> - 2009-05-29 23:27:21
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head><meta http-equiv="content-type" content="text/html; charset=utf-8" /><style type="text/css"><!-- #msg dl { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; } #msg dt { float: left; width: 6em; font-weight: bold; } #msg dt:after { content:':';} #msg dl, #msg dt, #msg ul, #msg li, #header, #footer { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; } #msg dl a { font-weight: bold} #msg dl a:link { color:#fc3; } #msg dl a:active { color:#ff0; } #msg dl a:visited { color:#cc6; } h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; } #msg pre { overflow: auto; background: #ffc; border: 1px #fc0 solid; padding: 6px; } #msg ul, pre { overflow: auto; } #header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; } #patch { width: 100%; } #patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;} #patch .propset h4, #patch .binary h4 {margin:0;} #patch pre {padding:0;line-height:1.2em;margin:0;} #patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;} #patch .propset .diff, #patch .binary .diff {padding:10px 0;} #patch span {display:block;padding:0 10px;} #patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;} #patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;} #patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;} #patch .lines, .info {color:#888;background:#fff;} --></style> <title>[5993] sqlalchemy/branches/rel_0_6: squeezing out py3k fixes.... sooo slowwww</title> </head> <body> <div id="msg"> <dl> <dt>Revision</dt> <dd>5993</dd> <dt>Author</dt> <dd>zzzeek</dd> <dt>Date</dt> <dd>2009-05-29 19:27:16 -0400 (Fri, 29 May 2009)</dd> </dl> <h3>Log Message</h3> <pre>squeezing out py3k fixes....sooo slowwww</pre> <h3>Modified Paths</h3> <ul> <li><a href="#sqlalchemybranchesrel_0_6libsqlalchemydialectsmssqlbasepy">sqlalchemy/branches/rel_0_6/lib/sqlalchemy/dialects/mssql/base.py</a></li> <li><a href="#sqlalchemybranchesrel_0_6libsqlalchemyenginebasepy">sqlalchemy/branches/rel_0_6/lib/sqlalchemy/engine/base.py</a></li> <li><a href="#sqlalchemybranchesrel_0_6libsqlalchemyenginereflectionpy">sqlalchemy/branches/rel_0_6/lib/sqlalchemy/engine/reflection.py</a></li> <li><a href="#sqlalchemybranchesrel_0_6libsqlalchemyenginestrategiespy">sqlalchemy/branches/rel_0_6/lib/sqlalchemy/engine/strategies.py</a></li> <li><a href="#sqlalchemybranchesrel_0_6libsqlalchemyengineurlpy">sqlalchemy/branches/rel_0_6/lib/sqlalchemy/engine/url.py</a></li> <li><a href="#sqlalchemybranchesrel_0_6libsqlalchemyschemapy">sqlalchemy/branches/rel_0_6/lib/sqlalchemy/schema.py</a></li> <li><a href="#sqlalchemybranchesrel_0_6testdialectmssqlpy">sqlalchemy/branches/rel_0_6/test/dialect/mssql.py</a></li> <li><a href="#sqlalchemybranchesrel_0_6testengineparseconnectpy">sqlalchemy/branches/rel_0_6/test/engine/parseconnect.py</a></li> </ul> </div> <div id="patch"> <h3>Diff</h3> <a id="sqlalchemybranchesrel_0_6libsqlalchemydialectsmssqlbasepy"></a> <div class="modfile"><h4>Modified: sqlalchemy/branches/rel_0_6/lib/sqlalchemy/dialects/mssql/base.py (5992 => 5993)</h4> <pre class="diff"><span> <span class="info">--- sqlalchemy/branches/rel_0_6/lib/sqlalchemy/dialects/mssql/base.py 2009-05-29 21:57:15 UTC (rev 5992) +++ sqlalchemy/branches/rel_0_6/lib/sqlalchemy/dialects/mssql/base.py 2009-05-29 23:27:16 UTC (rev 5993) </span><span class="lines">@@ -235,7 +235,7 @@ </span><span class="cx"> from sqlalchemy import types as sqltypes </span><span class="cx"> from decimal import Decimal as _python_Decimal </span><span class="cx"> </span><del>-import information_schema as ischema </del><ins>+from sqlalchemy.dialects.mssql import information_schema as ischema </ins><span class="cx"> </span><span class="cx"> MS_2008_VERSION = (10,) </span><span class="cx"> MS_2005_VERSION = (9,) </span></span></pre></div> <a id="sqlalchemybranchesrel_0_6libsqlalchemyenginebasepy"></a> <div class="modfile"><h4>Modified: sqlalchemy/branches/rel_0_6/lib/sqlalchemy/engine/base.py (5992 => 5993)</h4> <pre class="diff"><span> <span class="info">--- sqlalchemy/branches/rel_0_6/lib/sqlalchemy/engine/base.py 2009-05-29 21:57:15 UTC (rev 5992) +++ sqlalchemy/branches/rel_0_6/lib/sqlalchemy/engine/base.py 2009-05-29 23:27:16 UTC (rev 5993) </span><span class="lines">@@ -1067,7 +1067,12 @@ </span><span class="cx"> self._autorollback() </span><span class="cx"> if self.__close_with_result: </span><span class="cx"> self.close() </span><ins>+ # Py3K + #raise exc.DBAPIError.instance(statement, parameters, e, connection_invalidated=is_disconnect).with_traceback(sys.exc_info()[2]) + # Py2K </ins><span class="cx"> raise exc.DBAPIError.instance(statement, parameters, e, connection_invalidated=is_disconnect), None, sys.exc_info()[2] </span><ins>+ # end Py2K + </ins><span class="cx"> finally: </span><span class="cx"> del self._reentrant_error </span><span class="cx"> </span></span></pre></div> <a id="sqlalchemybranchesrel_0_6libsqlalchemyenginereflectionpy"></a> <div class="modfile"><h4>Modified: sqlalchemy/branches/rel_0_6/lib/sqlalchemy/engine/reflection.py (5992 => 5993)</h4> <pre class="diff"><span> <span class="info">--- sqlalchemy/branches/rel_0_6/lib/sqlalchemy/engine/reflection.py 2009-05-29 21:57:15 UTC (rev 5992) +++ sqlalchemy/branches/rel_0_6/lib/sqlalchemy/engine/reflection.py 2009-05-29 23:27:16 UTC (rev 5993) </span><span class="lines">@@ -235,9 +235,6 @@ </span><span class="cx"> </span><span class="cx"> dialect = self.conn.dialect </span><span class="cx"> </span><del>- # for some work arounds - from sqlalchemy.dialects.mysql.mysqldb import MySQLDialect - </del><span class="cx"> # MySQL dialect does this. Applicable with other dialects? </span><span class="cx"> if hasattr(dialect, '_connection_charset') \ </span><span class="cx"> and hasattr(dialect, '_adjust_casing'): </span><span class="lines">@@ -263,7 +260,7 @@ </span><span class="cx"> del tblkw[k] </span><span class="cx"> tblkw[str(k)] = v </span><span class="cx"> </span><del>- ### Py2K </del><ins>+ # Py2K </ins><span class="cx"> if isinstance(schema, str): </span><span class="cx"> schema = schema.decode(dialect.encoding) </span><span class="cx"> if isinstance(table_name, str): </span></span></pre></div> <a id="sqlalchemybranchesrel_0_6libsqlalchemyenginestrategiespy"></a> <div class="modfile"><h4>Modified: sqlalchemy/branches/rel_0_6/lib/sqlalchemy/engine/strategies.py (5992 => 5993)</h4> <pre class="diff"><span> <span class="info">--- sqlalchemy/branches/rel_0_6/lib/sqlalchemy/engine/strategies.py 2009-05-29 21:57:15 UTC (rev 5992) +++ sqlalchemy/branches/rel_0_6/lib/sqlalchemy/engine/strategies.py 2009-05-29 23:27:16 UTC (rev 5993) </span><span class="lines">@@ -76,7 +76,13 @@ </span><span class="cx"> return dialect.connect(*cargs, **cparams) </span><span class="cx"> except Exception, e: </span><span class="cx"> import sys </span><ins>+ + # Py3K + #raise exc.DBAPIError.instance(None, None, e).with_traceback(sys.exc_info()[2]) + # Py2K </ins><span class="cx"> raise exc.DBAPIError.instance(None, None, e), None, sys.exc_info()[2] </span><ins>+ # end Py2K + </ins><span class="cx"> creator = kwargs.pop('creator', connect) </span><span class="cx"> </span><span class="cx"> poolclass = (kwargs.pop('poolclass', None) or </span></span></pre></div> <a id="sqlalchemybranchesrel_0_6libsqlalchemyengineurlpy"></a> <div class="modfile"><h4>Modified: sqlalchemy/branches/rel_0_6/lib/sqlalchemy/engine/url.py (5992 => 5993)</h4> <pre class="diff"><span> <span class="info">--- sqlalchemy/branches/rel_0_6/lib/sqlalchemy/engine/url.py 2009-05-29 21:57:15 UTC (rev 5992) +++ sqlalchemy/branches/rel_0_6/lib/sqlalchemy/engine/url.py 2009-05-29 23:27:16 UTC (rev 5993) </span><span class="lines">@@ -170,8 +170,10 @@ </span><span class="cx"> tokens = components['database'].split('?', 2) </span><span class="cx"> components['database'] = tokens[0] </span><span class="cx"> query = (len(tokens) > 1 and dict(cgi.parse_qsl(tokens[1]))) or None </span><ins>+ # Py2K </ins><span class="cx"> if query is not None: </span><span class="cx"> query = dict((k.encode('ascii'), query[k]) for k in query) </span><ins>+ # end Py2K </ins><span class="cx"> else: </span><span class="cx"> query = None </span><span class="cx"> components['query'] = query </span></span></pre></div> <a id="sqlalchemybranchesrel_0_6libsqlalchemyschemapy"></a> <div class="modfile"><h4>Modified: sqlalchemy/branches/rel_0_6/lib/sqlalchemy/schema.py (5992 => 5993)</h4> <pre class="diff"><span> <span class="info">--- sqlalchemy/branches/rel_0_6/lib/sqlalchemy/schema.py 2009-05-29 21:57:15 UTC (rev 5992) +++ sqlalchemy/branches/rel_0_6/lib/sqlalchemy/schema.py 2009-05-29 23:27:16 UTC (rev 5993) </span><span class="lines">@@ -1020,7 +1020,9 @@ </span><span class="cx"> return lambda ctx: fn() </span><span class="cx"> </span><span class="cx"> positionals = len(argspec[0]) </span><del>- if inspect.ismethod(inspectable): </del><ins>+ + # Py3K compat - no unbound methods + if inspect.ismethod(inspectable) or inspect.isclass(fn): </ins><span class="cx"> positionals -= 1 </span><span class="cx"> </span><span class="cx"> if positionals == 0: </span></span></pre></div> <a id="sqlalchemybranchesrel_0_6testdialectmssqlpy"></a> <div class="modfile"><h4>Modified: sqlalchemy/branches/rel_0_6/test/dialect/mssql.py (5992 => 5993)</h4> <pre class="diff"><span> <span class="info">--- sqlalchemy/branches/rel_0_6/test/dialect/mssql.py 2009-05-29 21:57:15 UTC (rev 5992) +++ sqlalchemy/branches/rel_0_6/test/dialect/mssql.py 2009-05-29 23:27:16 UTC (rev 5993) </span><span class="lines">@@ -7,7 +7,7 @@ </span><span class="cx"> from sqlalchemy.sql import table, column </span><span class="cx"> from sqlalchemy.databases import mssql </span><span class="cx"> from sqlalchemy.dialects.mssql import pyodbc </span><del>-import sqlalchemy.engine.url as url </del><ins>+from sqlalchemy.engine import url </ins><span class="cx"> from testlib import * </span><span class="cx"> from testlib.testing import eq_ </span><span class="cx"> </span></span></pre></div> <a id="sqlalchemybranchesrel_0_6testengineparseconnectpy"></a> <div class="modfile"><h4>Modified: sqlalchemy/branches/rel_0_6/test/engine/parseconnect.py (5992 => 5993)</h4> <pre class="diff"><span> <span class="info">--- sqlalchemy/branches/rel_0_6/test/engine/parseconnect.py 2009-05-29 21:57:15 UTC (rev 5992) +++ sqlalchemy/branches/rel_0_6/test/engine/parseconnect.py 2009-05-29 23:27:16 UTC (rev 5993) </span><span class="lines">@@ -1,5 +1,6 @@ </span><span class="cx"> import testenv; testenv.configure_for_tests() </span><del>-import ConfigParser, StringIO </del><ins>+import ConfigParser +import StringIO </ins><span class="cx"> import sqlalchemy.engine.url as url </span><span class="cx"> from sqlalchemy import create_engine, engine_from_config </span><span class="cx"> import testlib.sa as tsa </span></span></pre> </div> </div> </body> </html> |