Skip to contentSkip to conversation

bitbake-layers: hide deprecation warnings

PATCH In review Paul Eggleton 2 participants 2 messages Apr 16, 2012

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 bitbake-layers: hide deprecation warnings

There are a number of DeprecationWarnings within BitBake code which bitbake itself filters out; bitbake-layers was not doing this, resulting in a stream of warnings printed out when used with Python < 2.7 (these warnings default to disabled on version 2.7 and above.)

---
 bin/bitbake-layers |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
bin/bitbake-layers +2 -0
index bbd56fe..6d35386 100755
@@ -9,6 +9,7 @@
 
 import cmd
 import logging
+import warnings
 import os
 import sys
 import fnmatch
@@ -28,6 +29,7 @@ import bb.fetch2
 
 logger = logging.getLogger('BitBake')
 
+warnings.filterwarnings("ignore", category=DeprecationWarning)
 
 def main(args):
     # Set up logging
Signature · 1 line
1.7.5.4
Tested-by on v1 1/1
#1 lore raw
Quoted 6 lines · Paul Eggleton

There are a number of DeprecationWarnings within BitBake code which bitbake itself filters out; bitbake-layers was not doing this, resulting in a stream of warnings printed out when used with Python< 2.7 (these warnings default to disabled on version 2.7 and above.)

Verified this fix on CentOS 6.2

Quoted 24 lines
---
  bin/bitbake-layers |    2 ++
  1 files changed, 2 insertions(+), 0 deletions(-)
bin/bitbake-layers +2 -0
index bbd56fe..6d35386 100755
@@ -9,6 +9,7 @@
 
  import cmd
  import logging
+import warnings
  import os
  import sys
  import fnmatch
@@ -28,6 +29,7 @@ import bb.fetch2
 
  logger = logging.getLogger('BitBake')
 
+warnings.filterwarnings("ignore", category=DeprecationWarning)
 
  def main(args):
      # Set up logging