Explorar o código

Fix the connection access in methods

Jovian (Netbook) %!s(int64=6) %!d(string=hai) anos
pai
achega
55589e50fa
Modificáronse 1 ficheiros con 2 adicións e 2 borrados
  1. 2 2
      connect.py

+ 2 - 2
connect.py

@@ -6,10 +6,10 @@ class DataConsumer():
 		self.conn = psycopg2.connect(credentials)
 
 	def __del__(self):
-		conn.close()
+		self.conn.close()
 
 	def getProductSet(self):
-		cursor = conn.cursor()
+		cursor = self.conn.cursor()
 
 		cursor.execute("SELECT * from Product")