Skip to content
This repository was archived by the owner on Mar 31, 2025. It is now read-only.

Commit f4047ea

Browse files
committed
Bugfix
1 parent 006d66b commit f4047ea

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

main.py

+5-2
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@
4747

4848

4949
def generateTdsFiles():
50+
conn = None
5051
try:
5152
regtype_mappings = None
5253

@@ -133,14 +134,16 @@ def generateTdsFiles():
133134
lineClear()
134135

135136
publishDataSource(filePath, dataSourceProjectId)
137+
138+
cur.close()
136139
except psycopg2.Error as e:
137140
print(e)
138141
finally:
139142
if verbose:
140143
print('Closing connection to DB: {}'.format(dbName))
141144

142-
cur.close()
143-
conn.close()
145+
if conn is not None:
146+
conn.close()
144147

145148

146149
def lineClear():

0 commit comments

Comments
 (0)