From 0f2c59367a649de5f57acdccfb4f1fdba9cde730 Mon Sep 17 00:00:00 2001 From: Richard Purdie Date: Thu, 12 May 2016 08:30:35 +0100 Subject: bitbake: bitbake: Convert to python 3 Various misc changes to convert bitbake to python3 which don't warrant separation into separate commits. (Bitbake rev: d0f904d407f57998419bd9c305ce53e5eaa36b24) Signed-off-by: Richard Purdie --- bitbake/lib/bb/pysh/builtin.py | 2 +- bitbake/lib/bb/pysh/interp.py | 4 ++-- bitbake/lib/bb/pysh/pyshlex.py | 2 +- bitbake/lib/bb/pysh/pyshyacc.py | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) (limited to 'bitbake/lib/bb/pysh') diff --git a/bitbake/lib/bb/pysh/builtin.py b/bitbake/lib/bb/pysh/builtin.py index b748e4a4f2..a8814dc330 100644 --- a/bitbake/lib/bb/pysh/builtin.py +++ b/bitbake/lib/bb/pysh/builtin.py @@ -527,7 +527,7 @@ def utility_sed(name, args, interp, env, stdin, stdout, stderr, debugflags): print interp.log(' '.join([name, str(args), interp['PWD']]) + '\n') # Scan pattern arguments and append a space if necessary - for i in xrange(len(args)): + for i in range(len(args)): if not RE_SED.search(args[i]): continue args[i] = args[i] + ' ' diff --git a/bitbake/lib/bb/pysh/interp.py b/bitbake/lib/bb/pysh/interp.py index 25d8c92ec4..d14ecf3c6d 100644 --- a/bitbake/lib/bb/pysh/interp.py +++ b/bitbake/lib/bb/pysh/interp.py @@ -474,7 +474,7 @@ class Environment: """ # Save and remove previous arguments prevargs = [] - for i in xrange(int(self._env['#'])): + for i in range(int(self._env['#'])): i = str(i+1) prevargs.append(self._env[i]) del self._env[i] @@ -488,7 +488,7 @@ class Environment: return prevargs def get_positional_args(self): - return [self._env[str(i+1)] for i in xrange(int(self._env['#']))] + return [self._env[str(i+1)] for i in range(int(self._env['#']))] def get_variables(self): return dict(self._env) diff --git a/bitbake/lib/bb/pysh/pyshlex.py b/bitbake/lib/bb/pysh/pyshlex.py index b30123675c..fbf094b7a9 100644 --- a/bitbake/lib/bb/pysh/pyshlex.py +++ b/bitbake/lib/bb/pysh/pyshlex.py @@ -20,7 +20,7 @@ except NameError: from Set import Set as set from ply import lex -from sherrors import * +from bb.pysh.sherrors import * class NeedMore(Exception): pass diff --git a/bitbake/lib/bb/pysh/pyshyacc.py b/bitbake/lib/bb/pysh/pyshyacc.py index e8e80aac45..ba4cefdcb8 100644 --- a/bitbake/lib/bb/pysh/pyshyacc.py +++ b/bitbake/lib/bb/pysh/pyshyacc.py @@ -10,11 +10,11 @@ import os.path import sys -import pyshlex +import bb.pysh.pyshlex as pyshlex tokens = pyshlex.tokens from ply import yacc -import sherrors +import bb.pysh.sherrors as sherrors class IORedirect: def __init__(self, op, filename, io_number=None): -- cgit v1.2.3-54-g00ecf