Skip to content

Commit 46b2705

Browse files
authored
Merge pull request #1 from A-Baji/populate-kwargs
apply changes requested by dmitri
2 parents 4f3093c + 53f38a7 commit 46b2705

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

datajoint/autopopulate.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ def populate(self, *restrictions, suppress_errors=False, return_exception_object
108108
:param display_progress: if True, report progress_bar
109109
:param limit: if not None, checks at most that many keys
110110
:param max_calls: if not None, populates at max that many keys
111-
:param kwargs: optional dict containing arguments that will be passed down to each make() call
111+
:param make_kwargs: optional dict containing keyword arguments that will be passed down to each make() call
112112
"""
113113
if self.connection.in_transaction:
114114
raise DataJointError('Populate cannot be called during a transaction.')
@@ -151,10 +151,7 @@ def handler(signum, frame):
151151
call_count += 1
152152
self.__class__._allow_insert = True
153153
try:
154-
if make_kwargs is not None:
155-
make(dict(key), **make_kwargs)
156-
else:
157-
make(dict(key))
154+
make(dict(key), **(make_kwargs or {}))
158155
except (KeyboardInterrupt, SystemExit, Exception) as error:
159156
try:
160157
self.connection.cancel_transaction()

0 commit comments

Comments
 (0)