Skip to contentSkip to conversation

bitbake-layers: add signal hander to avoid exception

PATCH New Zhixiong Chi 1 participant 1 message Apr 12, 2017

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 bitbake-layers: add signal hander to avoid exception

Fixed:
bitbake-layers show-recipes | less
press "q" to exit

There will be a Broken pipe error output as follows:
"BrokenPipeError: [Errno 32] Broken pipe"

---
 bin/bitbake-layers | 2 ++
 1 file changed, 2 insertions(+)
bin/bitbake-layers +2 -0
index 390ad05..2b05d28 100755
@@ -24,6 +24,7 @@ import logging
 import os
 import sys
 import argparse
+import signal
 
 bindir = os.path.dirname(__file__)
 topdir = os.path.dirname(bindir)
@@ -35,6 +36,7 @@ import bb.msg
 logger = bb.msg.logger_create('bitbake-layers', sys.stdout)
 
 def main():
+    signal.signal(signal.SIGPIPE, signal.SIG_DFL)
     parser = argparse.ArgumentParser(
         description="BitBake layers utility",
         epilog="Use %(prog)s <subcommand> --help to get help on a specific command",
Signature · 1 line
1.9.1