Changeset 4554 for palm


Ignore:
Timestamp:
Jun 4, 2020 11:34:15 AM (4 years ago)
Author:
eckhard
Message:

Resolve PyYAML deprecation warning.

PyYAML raises the warning:
palmtest:685: YAMLLoadWarning: calling yaml.load() without Loader=... is deprecated,
as the default Loader is unsafe. Please read https://msg.pyyaml.org/load for full details.

This commit adds the SafeLoader? as recommended on https://msg.pyyaml.org/load.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • palm/trunk/SCRIPTS/palmtest

    r4456 r4554  
    683683        try:
    684684            with open(os.path.join(Environment.trunk_tests_builds_dir, self.build_name, 'build_config.yml'), 'r') as f:
    685                 build_config = yaml.load(f)
     685                build_config = yaml.load(f, Loader=yaml.SafeLoader)
    686686        except:
    687687            return True, colored('[build not found]', 'red')
     
    756756        try:
    757757            with open(os.path.join(Environment.workspace_dir, 'palmtest.yml'), 'r') as f:
    758                 palmtest_config = yaml.load(f)
     758                palmtest_config = yaml.load(f, Loader=yaml.SafeLoader)
    759759        except:
    760760            return True, colored('[palmtest.yml not found]', 'red')
     
    928928        try:
    929929            with open(f_name, 'r') as f:
    930                 config = yaml.load(f)
     930                config = yaml.load(f, Loader=yaml.SafeLoader)
    931931        except:
    932932            return True, colored('[Case \"' + self.name + '\" could not be found.]', 'red')
Note: See TracChangeset for help on using the changeset viewer.