This commit is contained in:
Jing Ling
2020-09-16 00:48:41 +08:00
parent 78a1f14c91
commit 685d9ff5d2
+3 -3
View File
@@ -10,7 +10,7 @@ from sqlalchemy import create_engine, exc, inspect, text
DATABASE_URL = os.environ.get('DATABASE_URL') DATABASE_URL = os.environ.get('DATABASE_URL')
def isexception(obj): def is_exception(obj):
"""Given an object, return a boolean indicating whether it is an instance """Given an object, return a boolean indicating whether it is an instance
or subclass of :py:class:`Exception`. or subclass of :py:class:`Exception`.
""" """
@@ -212,7 +212,7 @@ class RecordCollection(object):
try: try:
record = self[0] record = self[0]
except IndexError: except IndexError:
if isexception(default): if is_exception(default):
raise default raise default
return default return default
@@ -276,7 +276,7 @@ class Database(object):
def __repr__(self): def __repr__(self):
return '<Database open={}>'.format(self.open) return '<Database open={}>'.format(self.open)
def get_table_names(self, internal=False): def get_table_names(self):
"""Returns a list of table names for the connected database.""" """Returns a list of table names for the connected database."""
# Setup SQLAlchemy for Database inspection. # Setup SQLAlchemy for Database inspection.