From 77f641429f019d06cc467ec4e57ae94f808d70bd Mon Sep 17 00:00:00 2001 From: Mike Bayer Date: Thu, 25 Nov 2010 12:20:13 -0500 Subject: - 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] --- lib/sqlalchemy/util.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'lib/sqlalchemy/util.py') 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): -- cgit v1.2.1