diff options
| author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2016-05-12 08:30:35 +0100 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2016-06-02 08:24:02 +0100 |
| commit | 0f2c59367a649de5f57acdccfb4f1fdba9cde730 (patch) | |
| tree | 7a3558a3e08e690fbb0b5bdc4044316f9ab4bbcb /bitbake/lib/bb/pysh | |
| parent | ef1df516512587ad415f76a9626620992d660e45 (diff) | |
| download | poky-0f2c59367a649de5f57acdccfb4f1fdba9cde730.tar.gz | |
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 <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/bb/pysh')
| -rw-r--r-- | bitbake/lib/bb/pysh/builtin.py | 2 | ||||
| -rw-r--r-- | bitbake/lib/bb/pysh/interp.py | 4 | ||||
| -rw-r--r-- | bitbake/lib/bb/pysh/pyshlex.py | 2 | ||||
| -rw-r--r-- | bitbake/lib/bb/pysh/pyshyacc.py | 4 |
4 files changed, 6 insertions, 6 deletions
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): | |||
| 527 | print interp.log(' '.join([name, str(args), interp['PWD']]) + '\n') | 527 | print interp.log(' '.join([name, str(args), interp['PWD']]) + '\n') |
| 528 | 528 | ||
| 529 | # Scan pattern arguments and append a space if necessary | 529 | # Scan pattern arguments and append a space if necessary |
| 530 | for i in xrange(len(args)): | 530 | for i in range(len(args)): |
| 531 | if not RE_SED.search(args[i]): | 531 | if not RE_SED.search(args[i]): |
| 532 | continue | 532 | continue |
| 533 | args[i] = args[i] + ' ' | 533 | 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: | |||
| 474 | """ | 474 | """ |
| 475 | # Save and remove previous arguments | 475 | # Save and remove previous arguments |
| 476 | prevargs = [] | 476 | prevargs = [] |
| 477 | for i in xrange(int(self._env['#'])): | 477 | for i in range(int(self._env['#'])): |
| 478 | i = str(i+1) | 478 | i = str(i+1) |
| 479 | prevargs.append(self._env[i]) | 479 | prevargs.append(self._env[i]) |
| 480 | del self._env[i] | 480 | del self._env[i] |
| @@ -488,7 +488,7 @@ class Environment: | |||
| 488 | return prevargs | 488 | return prevargs |
| 489 | 489 | ||
| 490 | def get_positional_args(self): | 490 | def get_positional_args(self): |
| 491 | return [self._env[str(i+1)] for i in xrange(int(self._env['#']))] | 491 | return [self._env[str(i+1)] for i in range(int(self._env['#']))] |
| 492 | 492 | ||
| 493 | def get_variables(self): | 493 | def get_variables(self): |
| 494 | return dict(self._env) | 494 | 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: | |||
| 20 | from Set import Set as set | 20 | from Set import Set as set |
| 21 | 21 | ||
| 22 | from ply import lex | 22 | from ply import lex |
| 23 | from sherrors import * | 23 | from bb.pysh.sherrors import * |
| 24 | 24 | ||
| 25 | class NeedMore(Exception): | 25 | class NeedMore(Exception): |
| 26 | pass | 26 | 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 @@ | |||
| 10 | import os.path | 10 | import os.path |
| 11 | import sys | 11 | import sys |
| 12 | 12 | ||
| 13 | import pyshlex | 13 | import bb.pysh.pyshlex as pyshlex |
| 14 | tokens = pyshlex.tokens | 14 | tokens = pyshlex.tokens |
| 15 | 15 | ||
| 16 | from ply import yacc | 16 | from ply import yacc |
| 17 | import sherrors | 17 | import bb.pysh.sherrors as sherrors |
| 18 | 18 | ||
| 19 | class IORedirect: | 19 | class IORedirect: |
| 20 | def __init__(self, op, filename, io_number=None): | 20 | def __init__(self, op, filename, io_number=None): |
