diff --git a/IfxAlchemy/IfxPy.py b/IfxAlchemy/IfxPy.py index 6c0d9ec..f8cc797 100644 --- a/IfxAlchemy/IfxPy.py +++ b/IfxAlchemy/IfxPy.py @@ -128,7 +128,7 @@ def do_execute(self, cursor, statement, parameters, context=None): _isolation_levels_returned = { value : key for key, value in _isolation_levels_cli.items()} def _get_cli_isolation_levels(self, level): - return _isolation_levels_cli[level] + return self._isolation_levels_cli[level] def set_isolation_level(self, connection, level): if level is None: @@ -143,7 +143,7 @@ def set_isolation_level(self, connection, level): "Valid isolation levels for %s are %s" % (level, self.name, ", ".join(self._isolation_lookup)) ) - attrib = {SQL_ATTR_TXN_ISOLATION:_get_cli_isolation_levels(self,level)} + attrib = {SQL_ATTR_TXN_ISOLATION: self._get_cli_isolation_levels(level)} res = connection.set_option(attrib) def reset_isolation_level(self, connection): diff --git a/IfxAlchemy/base.py b/IfxAlchemy/base.py index 57f3390..12b3192 100644 --- a/IfxAlchemy/base.py +++ b/IfxAlchemy/base.py @@ -400,9 +400,9 @@ def visit_select(self, select, **kwargs): sql = '%s, ( ROW_NUMBER() OVER() ) AS "%s" FROM ( %s ) AS M' % ( sql_sel, __rownum, sql_pri ) sql = '%s FROM ( %s ) Z WHERE' % ( sql_sel, sql ) - if offset is not 0: + if offset != 0: sql = '%s "%s" > %d' % ( sql, __rownum, offset ) - if offset is not 0 and limit is not None: + if offset != 0 and limit is not None: sql = '%s AND ' % ( sql ) if limit is not None: sql = '%s "%s" <= %d' % ( sql, __rownum, offset + limit )