From 3b3997174831931ea472167ba6cc854a4972ccce Mon Sep 17 00:00:00 2001 From: Richard Purdie Date: Fri, 20 May 2016 11:57:44 +0100 Subject: classes/lib: Complete transition to python3 This patch contains all the other misc pieces of the transition to python3 which didn't make sense to be broken into individual patches. (From OE-Core rev: fcd6b38bab8517d83e1ed48eef1bca9a9a190f57) Signed-off-by: Richard Purdie --- meta/lib/oe/terminal.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'meta/lib/oe/terminal.py') diff --git a/meta/lib/oe/terminal.py b/meta/lib/oe/terminal.py index 634daa9033..dc25d14ff6 100644 --- a/meta/lib/oe/terminal.py +++ b/meta/lib/oe/terminal.py @@ -25,9 +25,7 @@ class Registry(oe.classutils.ClassRegistry): return bool(cls.command) -class Terminal(Popen): - __metaclass__ = Registry - +class Terminal(Popen, metaclass=Registry): def __init__(self, sh_cmd, title=None, env=None, d=None): fmt_sh_cmd = self.format_command(sh_cmd, title) try: @@ -41,7 +39,7 @@ class Terminal(Popen): def format_command(self, sh_cmd, title): fmt = {'title': title or 'Terminal', 'command': sh_cmd} - if isinstance(self.command, basestring): + if isinstance(self.command, str): return shlex.split(self.command.format(**fmt)) else: return [element.format(**fmt) for element in self.command] -- cgit v1.2.3-54-g00ecf