def perform1(self): try: if (self.combo2.currentIndex() == 0 or self.combo3.currentIndex() == 0): QMessageBox.question(self, 'Warning!!', "Please Choose Valid Choice!", QMessageBox.NoButton) else: country = self.combo1.currentText() year1 = self.combo2.currentText() year2 = self.combo3.currentText() Graphs.Graph5(self, country, year1, year2) except BaseException as ex: print(ex)