From 40e56c4e30e31279049affdff2dccdf9853f6d17 Mon Sep 17 00:00:00 2001 From: "ALLENINST\\svc_ivscc" Date: Fri, 21 Nov 2025 11:26:46 -0800 Subject: [PATCH 1/2] Fix for pyyaml API change --- pytic/pytic.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pytic/pytic.py b/pytic/pytic.py index d4647f2..84e9bdd 100644 --- a/pytic/pytic.py +++ b/pytic/pytic.py @@ -292,7 +292,7 @@ def _reinitialize(self): def load_config(self, config_file): with open(config_file, 'r') as ymlfile: - cfg = yaml.load(ymlfile) + cfg = yaml.load(ymlfile, yaml.SafeLoader) cfg_settings = cfg['tic_settings'] From f4c0cef54e9cdc4c51577295f788f17696faeeb8 Mon Sep 17 00:00:00 2001 From: Luke Campagnola Date: Fri, 21 Nov 2025 14:01:40 -0800 Subject: [PATCH 2/2] retain support for older pyyaml --- pytic/pytic.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/pytic/pytic.py b/pytic/pytic.py index 84e9bdd..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, yaml.SafeLoader) + 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())