From: Mike Bayer Date: Sat, 17 Feb 2007 00:09:48 +0000 (+0000) Subject: - small fix to BoundMetaData to accept unicode or string URLs X-Git-Tag: rel_0_3_5~28 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=67f020f69cbca55150c2d793ba3f9fcb95749838;p=thirdparty%2Fsqlalchemy%2Fsqlalchemy.git - small fix to BoundMetaData to accept unicode or string URLs --- diff --git a/CHANGES b/CHANGES index 7e9d983c27..6e0224fc24 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 f492ce425c..2345a399b9 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 a2d328bf35..323d30da5c 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