Python 3 compatibility: replace execfile to exec(open(f).read(),filepath,'exec')

Story: 2003428
Task: 24616

Change-Id: I884d05da184316d8ef2f4f984efac197295513b0
Signed-off-by: Sun Austin <austin.sun@intel.com>
This commit is contained in:
Sun Austin 2018-08-23 11:48:41 +08:00 committed by Austin Sun
parent f8363efc7f
commit bafe59d6c5
1 changed files with 4 additions and 1 deletions

View File

@ -992,7 +992,10 @@ DEFAULT_THEME = 'titanium'
for root, dirs, files in os.walk('/opt/branding/applied'):
if 'manifest.py' in files:
execfile(os.path.join(root, 'manifest.py'))
with open(os.path.join(root, 'manifest.py')) as f:
code = compile(f.read(), os.path.join(root, 'manifest.py'), 'exec')
exec(code)
AVAILABLE_THEMES = [
('default', 'Default', 'themes/default'),
('material', 'Material', 'themes/material'),