From 0a23a439a6e5903ca0d03906641bf7ff824407dc Mon Sep 17 00:00:00 2001
From: Samuel Gaist <samuel.gaist@idiap.ch>
Date: Wed, 18 Apr 2018 15:02:23 +0200
Subject: [PATCH] [helpers] Fix key search in dictionaries

---
 beat/backend/python/helpers.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/beat/backend/python/helpers.py b/beat/backend/python/helpers.py
index d5a638b..ed2443b 100755
--- a/beat/backend/python/helpers.py
+++ b/beat/backend/python/helpers.py
@@ -62,7 +62,7 @@ def convert_experiment_configuration_to_container(config):
         data['range'] = config['range']
 
     data['inputs'] = \
-          dict([(k, { 'channel': v['channel'], 'path': v['path'], 'database': v.has_key('database') }) for k,v in config['inputs'].items()])
+          dict([(k, { 'channel': v['channel'], 'path': v['path'], 'database': 'database' in v }) for k,v in config['inputs'].items()])
 
     if 'outputs' in config:
         data['outputs'] = \
@@ -181,7 +181,7 @@ def create_inputs_from_configuration(config, algorithm, prefix, cache_root,
                 # Create of retrieve the database view
                 channel = details['channel']
 
-                if not views.has_key(channel):
+                if channel not in views:
                     view = db.view(details['protocol'], details['set'])
                     view.setup(os.path.join(cache_root, details['path']), pack=False,
                                start_index=start_index, end_index=end_index)
-- 
GitLab