소스 검색

Fix the connection access in methods

Jovian (Netbook) 6 년 전
부모
커밋
55589e50fa
1개의 변경된 파일2개의 추가작업 그리고 2개의 파일을 삭제
  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")