summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2007-02-17 00:09:48 +0000
committerMike Bayer <mike_mp@zzzcomputing.com>2007-02-17 00:09:48 +0000
commit67f020f69cbca55150c2d793ba3f9fcb95749838 (patch)
treee3f0df92eea862767eb9358479cab12507b01a04
parentf4c7027950cd38d2bf0a65ca830456fdd17903a1 (diff)
downloadsqlalchemy-67f020f69cbca55150c2d793ba3f9fcb95749838.tar.gz
- small fix to BoundMetaData to accept unicode or string URLs
-rw-r--r--CHANGES1
-rw-r--r--lib/sqlalchemy/engine/url.py2
-rw-r--r--lib/sqlalchemy/schema.py2
3 files changed, 3 insertions, 2 deletions
diff --git a/CHANGES b/CHANGES
index 7e9d983c2..6e0224fc2 100644
--- 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,
diff --git a/lib/sqlalchemy/engine/url.py b/lib/sqlalchemy/engine/url.py
index f492ce425..2345a399b 100644
--- a/lib/sqlalchemy/engine/url.py
+++ b/lib/sqlalchemy/engine/url.py
@@ -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
diff --git a/lib/sqlalchemy/schema.py b/lib/sqlalchemy/schema.py
index a2d328bf3..323d30da5 100644
--- a/lib/sqlalchemy/schema.py
+++ b/lib/sqlalchemy/schema.py
@@ -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