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/main.py | |
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/main.py')
-rwxr-xr-x | bitbake/lib/bb/main.py | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/bitbake/lib/bb/main.py b/bitbake/lib/bb/main.py index 761ea459cf..b296ef8b8c 100755 --- a/bitbake/lib/bb/main.py +++ b/bitbake/lib/bb/main.py | |||
@@ -27,6 +27,7 @@ import sys | |||
27 | import logging | 27 | import logging |
28 | import optparse | 28 | import optparse |
29 | import warnings | 29 | import warnings |
30 | import fcntl | ||
30 | 31 | ||
31 | import bb | 32 | import bb |
32 | from bb import event | 33 | from bb import event |
@@ -336,10 +337,7 @@ def start_server(servermodule, configParams, configuration, features): | |||
336 | server.saveConnectionDetails() | 337 | server.saveConnectionDetails() |
337 | except Exception as e: | 338 | except Exception as e: |
338 | while hasattr(server, "event_queue"): | 339 | while hasattr(server, "event_queue"): |
339 | try: | 340 | import queue |
340 | import queue | ||
341 | except ImportError: | ||
342 | import Queue as queue | ||
343 | try: | 341 | try: |
344 | event = server.event_queue.get(block=False) | 342 | event = server.event_queue.get(block=False) |
345 | except (queue.Empty, IOError): | 343 | except (queue.Empty, IOError): |
@@ -363,7 +361,10 @@ def bitbake_main(configParams, configuration): | |||
363 | # updates to log files for use with tail | 361 | # updates to log files for use with tail |
364 | try: | 362 | try: |
365 | if sys.stdout.name == '<stdout>': | 363 | if sys.stdout.name == '<stdout>': |
366 | sys.stdout = os.fdopen(sys.stdout.fileno(), 'w', 0) | 364 | # Reopen with O_SYNC (unbuffered) |
365 | fl = fcntl.fcntl(sys.stdout.fileno(), fcntl.F_GETFL) | ||
366 | fl |= os.O_SYNC | ||
367 | fcntl.fcntl(sys.stdout.fileno(), fcntl.F_SETFL, fl) | ||
367 | except: | 368 | except: |
368 | pass | 369 | pass |
369 | 370 | ||