diff options
| author | Chris Larson <chris_larson@mentor.com> | 2010-06-20 12:08:07 -0700 |
|---|---|---|
| committer | Richard Purdie <rpurdie@linux.intel.com> | 2010-07-02 15:41:37 +0100 |
| commit | ef1de9ecaf73e28234d284b79ec45e084d0f0c53 (patch) | |
| tree | 417f87922c1a2fa4a3bbd4b35e0772221f96641e /bitbake/lib/bb/cooker.py | |
| parent | 20dc452614c991d1a4f5b7dcc1307cd03cba0c55 (diff) | |
| download | poky-ef1de9ecaf73e28234d284b79ec45e084d0f0c53.tar.gz | |
Apply some 2to3 refactorings
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
Diffstat (limited to 'bitbake/lib/bb/cooker.py')
| -rw-r--r-- | bitbake/lib/bb/cooker.py | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/bitbake/lib/bb/cooker.py b/bitbake/lib/bb/cooker.py index 2b3dfb0cb4..6884e9a554 100644 --- a/bitbake/lib/bb/cooker.py +++ b/bitbake/lib/bb/cooker.py | |||
| @@ -173,7 +173,7 @@ class BBCooker: | |||
| 173 | except bb.build.FuncFailed: | 173 | except bb.build.FuncFailed: |
| 174 | bb.msg.error(bb.msg.domain.Build, "task stack execution failed") | 174 | bb.msg.error(bb.msg.domain.Build, "task stack execution failed") |
| 175 | raise | 175 | raise |
| 176 | except bb.build.EventException, e: | 176 | except bb.build.EventException as e: |
| 177 | event = e.args[1] | 177 | event = e.args[1] |
| 178 | bb.msg.error(bb.msg.domain.Build, "%s event exception, aborting" % bb.event.getName(event)) | 178 | bb.msg.error(bb.msg.domain.Build, "%s event exception, aborting" % bb.event.getName(event)) |
| 179 | raise | 179 | raise |
| @@ -259,10 +259,10 @@ class BBCooker: | |||
| 259 | if fn: | 259 | if fn: |
| 260 | try: | 260 | try: |
| 261 | envdata = self.bb_cache.loadDataFull(fn, self.configuration.data) | 261 | envdata = self.bb_cache.loadDataFull(fn, self.configuration.data) |
| 262 | except IOError, e: | 262 | except IOError as e: |
| 263 | bb.msg.error(bb.msg.domain.Parsing, "Unable to read %s: %s" % (fn, e)) | 263 | bb.msg.error(bb.msg.domain.Parsing, "Unable to read %s: %s" % (fn, e)) |
| 264 | raise | 264 | raise |
| 265 | except Exception, e: | 265 | except Exception as e: |
| 266 | bb.msg.error(bb.msg.domain.Parsing, "%s" % e) | 266 | bb.msg.error(bb.msg.domain.Parsing, "%s" % e) |
| 267 | raise | 267 | raise |
| 268 | 268 | ||
| @@ -272,7 +272,7 @@ class BBCooker: | |||
| 272 | with closing(StringIO()) as env: | 272 | with closing(StringIO()) as env: |
| 273 | data.emit_env(env, envdata, True) | 273 | data.emit_env(env, envdata, True) |
| 274 | bb.msg.plain(env.getvalue()) | 274 | bb.msg.plain(env.getvalue()) |
| 275 | except Exception, e: | 275 | except Exception as e: |
| 276 | bb.msg.fatal(bb.msg.domain.Parsing, "%s" % e) | 276 | bb.msg.fatal(bb.msg.domain.Parsing, "%s" % e) |
| 277 | 277 | ||
| 278 | # emit the metadata which isnt valid shell | 278 | # emit the metadata which isnt valid shell |
| @@ -499,7 +499,7 @@ class BBCooker: | |||
| 499 | """Drop off into a shell""" | 499 | """Drop off into a shell""" |
| 500 | try: | 500 | try: |
| 501 | from bb import shell | 501 | from bb import shell |
| 502 | except ImportError, details: | 502 | except ImportError as details: |
| 503 | bb.msg.fatal(bb.msg.domain.Parsing, "Sorry, shell not available (%s)" % details ) | 503 | bb.msg.fatal(bb.msg.domain.Parsing, "Sorry, shell not available (%s)" % details ) |
| 504 | else: | 504 | else: |
| 505 | shell.start( self ) | 505 | shell.start( self ) |
| @@ -569,9 +569,9 @@ class BBCooker: | |||
| 569 | bb.event.fire(bb.event.ConfigParsed(), self.configuration.data) | 569 | bb.event.fire(bb.event.ConfigParsed(), self.configuration.data) |
| 570 | 570 | ||
| 571 | 571 | ||
| 572 | except IOError, e: | 572 | except IOError as e: |
| 573 | bb.msg.fatal(bb.msg.domain.Parsing, "Error when parsing %s: %s" % (files, str(e))) | 573 | bb.msg.fatal(bb.msg.domain.Parsing, "Error when parsing %s: %s" % (files, str(e))) |
| 574 | except bb.parse.ParseError, details: | 574 | except bb.parse.ParseError as details: |
| 575 | bb.msg.fatal(bb.msg.domain.Parsing, "Unable to parse %s (%s)" % (files, details) ) | 575 | bb.msg.fatal(bb.msg.domain.Parsing, "Unable to parse %s (%s)" % (files, details) ) |
| 576 | 576 | ||
| 577 | def handleCollections( self, collections ): | 577 | def handleCollections( self, collections ): |
| @@ -978,7 +978,7 @@ class CookerParser: | |||
| 978 | self.skipped += skipped | 978 | self.skipped += skipped |
| 979 | self.virtuals += virtuals | 979 | self.virtuals += virtuals |
| 980 | 980 | ||
| 981 | except IOError, e: | 981 | except IOError as e: |
| 982 | self.error += 1 | 982 | self.error += 1 |
| 983 | cooker.bb_cache.remove(f) | 983 | cooker.bb_cache.remove(f) |
| 984 | bb.msg.error(bb.msg.domain.Collection, "opening %s: %s" % (f, e)) | 984 | bb.msg.error(bb.msg.domain.Collection, "opening %s: %s" % (f, e)) |
| @@ -987,7 +987,7 @@ class CookerParser: | |||
| 987 | cooker.bb_cache.remove(f) | 987 | cooker.bb_cache.remove(f) |
| 988 | cooker.bb_cache.sync() | 988 | cooker.bb_cache.sync() |
| 989 | raise | 989 | raise |
| 990 | except Exception, e: | 990 | except Exception as e: |
| 991 | self.error += 1 | 991 | self.error += 1 |
| 992 | cooker.bb_cache.remove(f) | 992 | cooker.bb_cache.remove(f) |
| 993 | bb.msg.error(bb.msg.domain.Collection, "%s while parsing %s" % (e, f)) | 993 | bb.msg.error(bb.msg.domain.Collection, "%s while parsing %s" % (e, f)) |
