diff options
Diffstat (limited to 'meta/lib/oe/terminal.py')
-rw-r--r-- | meta/lib/oe/terminal.py | 6 |
1 files changed, 2 insertions, 4 deletions
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): | |||
25 | return bool(cls.command) | 25 | return bool(cls.command) |
26 | 26 | ||
27 | 27 | ||
28 | class Terminal(Popen): | 28 | class Terminal(Popen, metaclass=Registry): |
29 | __metaclass__ = Registry | ||
30 | |||
31 | def __init__(self, sh_cmd, title=None, env=None, d=None): | 29 | def __init__(self, sh_cmd, title=None, env=None, d=None): |
32 | fmt_sh_cmd = self.format_command(sh_cmd, title) | 30 | fmt_sh_cmd = self.format_command(sh_cmd, title) |
33 | try: | 31 | try: |
@@ -41,7 +39,7 @@ class Terminal(Popen): | |||
41 | 39 | ||
42 | def format_command(self, sh_cmd, title): | 40 | def format_command(self, sh_cmd, title): |
43 | fmt = {'title': title or 'Terminal', 'command': sh_cmd} | 41 | fmt = {'title': title or 'Terminal', 'command': sh_cmd} |
44 | if isinstance(self.command, basestring): | 42 | if isinstance(self.command, str): |
45 | return shlex.split(self.command.format(**fmt)) | 43 | return shlex.split(self.command.format(**fmt)) |
46 | else: | 44 | else: |
47 | return [element.format(**fmt) for element in self.command] | 45 | return [element.format(**fmt) for element in self.command] |