]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
- small fix to BoundMetaData to accept unicode or string URLs
authorMike Bayer <mike_mp@zzzcomputing.com>
Sat, 17 Feb 2007 00:09:48 +0000 (00:09 +0000)
committerMike Bayer <mike_mp@zzzcomputing.com>
Sat, 17 Feb 2007 00:09:48 +0000 (00:09 +0000)
CHANGES
lib/sqlalchemy/engine/url.py
lib/sqlalchemy/schema.py

diff --git a/CHANGES b/CHANGES
index 7e9d983c27912f4d8c5405ce45d31bdb9e92da63..6e0224fc24248124d4b0e716120ba5e6cfbc4f88 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -11,6 +11,7 @@
   - fixed argument passing to straight textual execute() on engine, connection.
   can handle *args or a list instance for positional, **kwargs or a dict instance
   for named args, or a list of list or dicts to invoke executemany()
+  - small fix to BoundMetaData to accept unicode or string URLs
 - orm:
   - another refactoring to relationship calculation.  Allows more accurate ORM behavior
   with relationships from/to/between mappers, particularly polymorphic mappers,
index f492ce425c842f47348a0cd29255fba5d1e006db..2345a399b9ba061b923e82b6249ad1462e1701b4 100644 (file)
@@ -80,7 +80,7 @@ def make_url(name_or_url):
     
     the given string is parsed according to the rfc1738 spec.
     if an existing URL object is passed, just returns the object."""
-    if isinstance(name_or_url, str) or isinstance(name_or_url, unicode):
+    if isinstance(name_or_url, basestring):
         return _parse_rfc1738_args(name_or_url)
     else:
         return name_or_url
index a2d328bf354812154c2f0a3eaf48ab6b780aa4dc..323d30da5cd768c41ce6d6be7953ee9af0385f15 100644 (file)
@@ -914,7 +914,7 @@ class BoundMetaData(MetaData):
     """builds upon MetaData to provide the capability to bind to an Engine implementation."""
     def __init__(self, engine_or_url, name=None, **kwargs):
         super(BoundMetaData, self).__init__(name, **kwargs)
-        if isinstance(engine_or_url, str):
+        if isinstance(engine_or_url, basestring):
             self._engine = sqlalchemy.create_engine(engine_or_url, **kwargs)
         else:
             self._engine = engine_or_url