Skip to content

Commit 7b3403e

Browse files
authored
Fix post/get_table not closed (#137)
* Update _posts.py For post_table close the table when done * Update _gets.py * move close to the end of the function
1 parent c765372 commit 7b3403e

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

ezomero/_gets.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1704,6 +1704,7 @@ def get_table(conn: BlitzGateway, file_ann_id: int,
17041704
try:
17051705
table_obj = resources.openTable(orig_table_file._obj)
17061706
table = _create_table(table_obj)
1707+
table_obj.close()
17071708
except InternalException:
17081709
logging.warning(f" FileAnnotation {file_ann_id} is not a table.")
17091710
else:

ezomero/_posts.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -700,6 +700,7 @@ def post_table(conn: BlitzGateway, table: Any,
700700
file_obj.save()
701701
file_ann.setFile(file_obj)
702702
file_ann = obj.linkAnnotation(file_ann)
703+
table.close()
703704
return file_ann.id
704705

705706

0 commit comments

Comments
 (0)