Skip to content

Commit d04f6ce

Browse files
fix #720
1 parent a9aad89 commit d04f6ce

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

datajoint/autopopulate.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,8 @@
55
import random
66
import inspect
77
from tqdm import tqdm
8-
from pymysql import OperationalError
98
from .expression import QueryExpression, AndList, U
10-
from .errors import DataJointError
9+
from .errors import DataJointError, LostConnectionError
1110
from .table import FreeTable
1211
import signal
1312

@@ -161,7 +160,7 @@ def handler(signum, frame):
161160
except (KeyboardInterrupt, SystemExit, Exception) as error:
162161
try:
163162
self.connection.cancel_transaction()
164-
except OperationalError:
163+
except LostConnectionError:
165164
pass
166165
error_message = '{exception}{msg}'.format(
167166
exception=error.__class__.__name__,

datajoint/table.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -127,18 +127,18 @@ def parents(self, primary=None):
127127

128128
def children(self, primary=None):
129129
"""
130-
:param primary: if None, then all parents are returned. If True, then only foreign keys composed of
130+
:param primary: if None, then all children are returned. If True, then only foreign keys composed of
131131
primary key attributes are considered. If False, the only foreign keys including at least one non-primary
132132
attribute are considered.
133133
:return: dict of tables with foreign keys referencing self
134134
"""
135135
return self.connection.dependencies.children(self.full_table_name, primary)
136136

137137
def descendants(self):
138-
return self. connection.dependencies.descendants(self.full_table_name)
138+
return self.connection.dependencies.descendants(self.full_table_name)
139139

140140
def ancestors(self):
141-
return self. connection.dependencies.ancestors(self.full_table_name)
141+
return self.connection.dependencies.ancestors(self.full_table_name)
142142

143143
@property
144144
def is_declared(self):

0 commit comments

Comments
 (0)