lirc/pyyaml-60-compatibility.patch

54 lines
2.1 KiB
Diff

---
python-pkg/lirc/database.py | 8 ++++----
tools/check_configs.py | 2 +-
2 files changed, 5 insertions(+), 5 deletions(-)
--- a/python-pkg/lirc/database.py
+++ b/python-pkg/lirc/database.py
@@ -66,7 +66,7 @@ def _load_kerneldrivers(configdir):
'''
with open(os.path.join(configdir, "kernel-drivers.yaml")) as f:
- cf = yaml.load(f.read())
+ cf = yaml.load(f.read(), Loader=yaml.Loader)
drivers = cf['drivers'].copy()
for driver in cf['drivers']:
if driver == 'default':
@@ -132,14 +132,14 @@ class Database(object):
yamlpath = configdir
db = {}
with open(os.path.join(yamlpath, "confs_by_driver.yaml")) as f:
- cf = yaml.load(f.read())
+ cf = yaml.load(f.read(), Loader=yaml.Loader)
db['lircd_by_driver'] = cf['lircd_by_driver'].copy()
db['lircmd_by_driver'] = cf['lircmd_by_driver'].copy()
db['kernel-drivers'] = _load_kerneldrivers(configdir)
db['drivers'] = db['kernel-drivers'].copy()
with open(os.path.join(yamlpath, "drivers.yaml")) as f:
- cf = yaml.load(f.read())
+ cf = yaml.load(f.read(), Loader=yaml.Loader)
db['drivers'].update(cf['drivers'].copy())
for key, d in db['drivers'].items():
d['id'] = key
@@ -158,7 +158,7 @@ class Database(object):
configs = {}
for path in sorted(glob.glob(configdir + '/*.conf')):
with open(path) as f:
- cf = yaml.load(f.read())
+ cf = yaml.load(f.read(), Loader=yaml.Loader)
configs[cf['config']['id']] = cf['config']
db['configs'] = configs
self.db = db
--- a/tools/check_configs.py
+++ b/tools/check_configs.py
@@ -9,7 +9,7 @@ def main():
configs = {}
for path in glob.glob('*.conf'):
with open(path) as f:
- cf = yaml.load(f.read())
+ cf = yaml.load(f.read(), Loader=yaml.Loader)
if cf['config']['id'] + '.conf' != path:
print( "Id: %s, path: %s" % (cf['config']['id'], path))
configs[cf['config']['id']] = cf['config']