aboutsummaryrefslogtreecommitdiff
path: root/scripts/maintenance/readProbeSetSE_v7.py
diff options
context:
space:
mode:
authorFrederick Muriuki Muriithi2022-03-10 08:55:26 +0300
committerFrederick Muriuki Muriithi2022-03-10 08:55:26 +0300
commit4a7e2c1602ed82aabd7d04953067ba49cb1cebff (patch)
treeea8c0cf11f1629d79844b2a4e9bb49a69e0bba33 /scripts/maintenance/readProbeSetSE_v7.py
parent80b02d37f60d172be01bf8cd62bd84b406b1e0dd (diff)
downloadgenenetwork2-4a7e2c1602ed82aabd7d04953067ba49cb1cebff.tar.gz
Use context manager with database connection
Use the `with` context manager with database connections and cursors to ensure that they are closed once they are no longer needed. Where it was not feasible to use the `with` context manager without a huge refactor/rewrite, the cursors and connections are closed manually.
Diffstat (limited to 'scripts/maintenance/readProbeSetSE_v7.py')
-rwxr-xr-xscripts/maintenance/readProbeSetSE_v7.py1
1 files changed, 1 insertions, 0 deletions
diff --git a/scripts/maintenance/readProbeSetSE_v7.py b/scripts/maintenance/readProbeSetSE_v7.py
index 2cfe2e07..88a347bf 100755
--- a/scripts/maintenance/readProbeSetSE_v7.py
+++ b/scripts/maintenance/readProbeSetSE_v7.py
@@ -251,4 +251,5 @@ if len(DataValues) > 0:
cmd = 'insert ProbeSetSE values %s' % DataValues
db.execute(cmd)
+db.close()
con.close()