summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xbitbake/bin/bitbake20
1 files changed, 18 insertions, 2 deletions
diff --git a/bitbake/bin/bitbake b/bitbake/bin/bitbake
index c2088d9320..8fdb6540a2 100755
--- a/bitbake/bin/bitbake
+++ b/bitbake/bin/bitbake
@@ -24,7 +24,10 @@
24 24
25import sys, os, getopt, re, time, optparse, xmlrpclib 25import sys, os, getopt, re, time, optparse, xmlrpclib
26sys.path.insert(0,os.path.join(os.path.dirname(os.path.dirname(sys.argv[0])), 'lib')) 26sys.path.insert(0,os.path.join(os.path.dirname(os.path.dirname(sys.argv[0])), 'lib'))
27
28import warnings
27import bb 29import bb
30import bb.msg
28from bb import cooker 31from bb import cooker
29from bb import ui 32from bb import ui
30from bb import server 33from bb import server
@@ -60,6 +63,21 @@ def print_exception(exc, value, tb):
60 63
61 sys.__excepthook__(exc, value, tb) 64 sys.__excepthook__(exc, value, tb)
62 65
66sys.excepthook = print_exception
67
68
69_warnings_showwarning = warnings.showwarning
70def _showwarning(message, category, filename, lineno, file=None, line=None):
71 """Display python warning messages using bb.msg"""
72 if file is not None:
73 if _warnings_showwarning is not None:
74 _warnings_showwarning(message, category, filename, lineno, file, line)
75 else:
76 s = warnings.formatwarning(message, category, filename, lineno)
77 s = s.split("\n")[0]
78 bb.msg.warn(None, s)
79
80warnings.showwarning = _showwarning
63 81
64#============================================================================# 82#============================================================================#
65# main 83# main
@@ -169,8 +187,6 @@ Default BBFILES are the .bb files in the current directory.""" )
169 server.BitBakeServerFork(serverinfo, cooker.serve, cooker_logfile) 187 server.BitBakeServerFork(serverinfo, cooker.serve, cooker_logfile)
170 del cooker 188 del cooker
171 189
172 sys.excepthook = print_exception
173
174 # Setup a connection to the server (cooker) 190 # Setup a connection to the server (cooker)
175 serverConnection = server.BitBakeServerConnection(serverinfo) 191 serverConnection = server.BitBakeServerConnection(serverinfo)
176 192