diff --git a/pytic/pytic.py b/pytic/pytic.py index d4647f2..e4b55aa 100644 --- a/pytic/pytic.py +++ b/pytic/pytic.py @@ -292,7 +292,10 @@ def _reinitialize(self): def load_config(self, config_file): with open(config_file, 'r') as ymlfile: - cfg = yaml.load(ymlfile) + if yaml.__version__.split('.')[:2] < ['5', '1']: + cfg = yaml.load(ymlfile) + else: + cfg = yaml.load(ymlfile, yaml.SafeLoader) cfg_settings = cfg['tic_settings'] @@ -326,4 +329,4 @@ def load_config(self, config_file): if __name__ == '__main__': tic = PyTic() - print(tic.list_connected_device_serial_numbers()) \ No newline at end of file + print(tic.list_connected_device_serial_numbers())