X-Git-Url: https://git.saurik.com/cyql.git/blobdiff_plain/c8a72a64388a60fa511cd7a2dc344c3b0e438844..a056a39170d14aa13eba1c726abbc4829adf7be8:/__init__.py diff --git a/__init__.py b/__init__.py index 53e8de3..885d2ae 100644 --- a/__init__.py +++ b/__init__.py @@ -1,5 +1,9 @@ -from __future__ import unicode_literals +from __future__ import absolute_import +from __future__ import division from __future__ import print_function +from __future__ import unicode_literals + +from future_builtins import ascii, filter, hex, map, oct, zip import inspect import os @@ -12,13 +16,6 @@ import psycopg2.pool psycopg2.extensions.register_type(psycopg2.extensions.UNICODE) -def one(values): - if values == None or len(values) == 0: - return None - else: - assert len(values) == 1 - return values[0] - class connect(object): def __init__(self, dsn): attempt = 0 @@ -113,7 +110,8 @@ class connect(object): return self.one_(statement) def has(self, statement): - return one(self.one_('select exists(%s)' % (statement,))) + exists, = self.one_('select exists(%s)' % (statement,)) + return exists def connected(dsn): def wrapped(method):