From 3249e33251102069c88e2bc3f703cfab51444668 Mon Sep 17 00:00:00 2001 From: Ed Bartosh Date: Tue, 10 May 2016 16:27:19 +0300 Subject: bitbake: toaster: use 'in' instead of has_key Dictionary method has_key is deprecated in python 2 and absent in python 3. Used ' in ' statement to make the code working on both python 2 and python 3. [YOCTO #9584] (Bitbake rev: 3d7ad7ba0d1a6f688ae885817c049f2a8ced11b5) Signed-off-by: Ed Bartosh Signed-off-by: Richard Purdie --- bitbake/lib/toaster/toastermain/settings.py | 2 +- bitbake/lib/toaster/toastermain/urls.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'bitbake/lib/toaster/toastermain') diff --git a/bitbake/lib/toaster/toastermain/settings.py b/bitbake/lib/toaster/toastermain/settings.py index 8662f393a9..78702fa59e 100644 --- a/bitbake/lib/toaster/toastermain/settings.py +++ b/bitbake/lib/toaster/toastermain/settings.py @@ -321,7 +321,7 @@ currentdir = os.path.dirname(__file__) for t in os.walk(os.path.dirname(currentdir)): modulename = os.path.basename(t[0]) #if we have a virtualenv skip it to avoid incorrect imports - if os.environ.has_key('VIRTUAL_ENV') and os.environ['VIRTUAL_ENV'] in t[0]: + if 'VIRTUAL_ENV' in os.environ and os.environ['VIRTUAL_ENV'] in t[0]: continue if ("views.py" in t[2] or "models.py" in t[2]) and not modulename in INSTALLED_APPS: diff --git a/bitbake/lib/toaster/toastermain/urls.py b/bitbake/lib/toaster/toastermain/urls.py index 530a42ffab..1f8599edc3 100644 --- a/bitbake/lib/toaster/toastermain/urls.py +++ b/bitbake/lib/toaster/toastermain/urls.py @@ -71,7 +71,7 @@ import os currentdir = os.path.dirname(__file__) for t in os.walk(os.path.dirname(currentdir)): #if we have a virtualenv skip it to avoid incorrect imports - if os.environ.has_key('VIRTUAL_ENV') and os.environ['VIRTUAL_ENV'] in t[0]: + if 'VIRTUAL_ENV' in os.environ and os.environ['VIRTUAL_ENV'] in t[0]: continue if "urls.py" in t[2] and t[0] != currentdir: -- cgit v1.2.3-54-g00ecf