code: def _cursor_exit(cursor, exc_type, exc_value, traceback):
      
      if exc_type is not None:
          print(exc_value, traceback)
      cursor.connection.close()
docs: cursor with문과 쓸수 있게 __exit__에 바인딩
      :param cursor:
      :param exc_type:
      :param exc_value:
      :param traceback:
      :return: