From f1aa930871aac692d10dfdf0ba1e7a52ca4fa05b Mon Sep 17 00:00:00 2001 From: Ahmed Gad Date: Tue, 9 May 2023 12:05:47 -0400 Subject: [PATCH] Use exist() from sys lib --- pygad/pygad.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pygad/pygad.py b/pygad/pygad.py index 9839c05..01dc850 100644 --- a/pygad/pygad.py +++ b/pygad/pygad.py @@ -9,6 +9,7 @@ from pygad import utils from pygad import helper from pygad import visualize +import sys class GA(utils.parent_selection.ParentSelection, utils.crossover.Crossover, @@ -1201,7 +1202,7 @@ def __init__(self, self.last_generation_elitism_indices = None except Exception as e: self.logger.exception(e) - exit(-1) + sys.exit(-1) def round_genes(self, solutions): for gene_idx in range(self.num_genes):