-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
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
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):