diff --git a/config/gym.py b/config/gym.py index 8ee0000..f9b3a0c 100644 --- a/config/gym.py +++ b/config/gym.py @@ -13,10 +13,9 @@ def __init__(self, config: dict, debug=False): self.rom_path = config['rom_path'] self.state_path = config['state_path'] - try: - self.pyboy = PyBoy(self.rom_path) - except (FileNotFoundError): - raise SystemExit("You should have your ROM in the roms/ folder") + assert self.rom_path is not None, "ROM path is required" + + self.pyboy = PyBoy(self.rom_path) self._fitness = 0 self._previous_fitness = 0