diff options
| author | Mike Bayer <mike_mp@zzzcomputing.com> | 2010-11-25 12:20:13 -0500 |
|---|---|---|
| committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2010-11-25 12:20:13 -0500 |
| commit | 77f641429f019d06cc467ec4e57ae94f808d70bd (patch) | |
| tree | 94ddacadb8915d19d3ee3cdf7a3771fa63ba0184 /lib/sqlalchemy/util.py | |
| parent | 5247c244ca6595f2685f1c0c271618eda7cb5e62 (diff) | |
| download | sqlalchemy-77f641429f019d06cc467ec4e57ae94f808d70bd.tar.gz | |
- Fixed operator precedence rules for multiple
chains of a single non-associative operator.
I.e. "x - (y - z)" will compile as "x - (y - z)"
and not "x - y - z". Also works with labels,
i.e. "x - (y - z).label('foo')"
[ticket:1984]
- Single element tuple expressions inside an IN clause
parenthesize correctly, also from [ticket:1984],
added tests for PG
- re-fix again importlater, [ticket:1983]
Diffstat (limited to 'lib/sqlalchemy/util.py')
| -rw-r--r-- | lib/sqlalchemy/util.py | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/lib/sqlalchemy/util.py b/lib/sqlalchemy/util.py index dafba8250..59704e41b 100644 --- a/lib/sqlalchemy/util.py +++ b/lib/sqlalchemy/util.py @@ -1579,12 +1579,8 @@ class importlater(object): @memoized_property def _il_module(self): if self._il_addtl: - m = __import__(self._il_path + "." + self._il_addtl) - else: - m = __import__(self._il_path) - for token in self._il_path.split(".")[1:]: - m = getattr(m, token) - if self._il_addtl: + m = __import__(self._il_path, globals(), locals(), + [self._il_addtl]) try: return getattr(m, self._il_addtl) except AttributeError: @@ -1593,6 +1589,9 @@ class importlater(object): (self._il_path, self._il_addtl) ) else: + m = __import__(self._il_path) + for token in self._il_path.split(".")[1:]: + m = getattr(m, token) return m def __getattr__(self, key): |
