From 762a0becfa42cbc4555d7607606dbee68213e5d9 Mon Sep 17 00:00:00 2001 From: Jeremy Goecks Date: Tue, 12 Apr 2011 17:26:06 -0400 Subject: [PATCH] Make changes in ddea56886275 compatible with python 2.4 --- lib/galaxy/datatypes/util/gff_util.py | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/lib/galaxy/datatypes/util/gff_util.py b/lib/galaxy/datatypes/util/gff_util.py index f0820670bfe..d62e8146aa2 100644 --- a/lib/galaxy/datatypes/util/gff_util.py +++ b/lib/galaxy/datatypes/util/gff_util.py @@ -149,8 +149,9 @@ class GFFReaderWrapper( NiceReaderWrapper ): self.seed_interval = GenomicIntervalReader.next( self ) except ParseError, e: handle_parse_error( e ) - finally: - raw_size += len( self.current_line ) + # TODO: When no longer supporting python 2.4 use finally: + #finally: + raw_size += len( self.current_line ) # If header or comment, clear seed interval and return it. if isinstance( self.seed_interval, ( Header, Comment ) ): @@ -170,16 +171,20 @@ class GFFReaderWrapper( NiceReaderWrapper ): while True: try: interval = GenomicIntervalReader.next( self ) + raw_size += len( self.current_line ) except StopIteration, e: # No more intervals to read, but last feature needs to be # returned. interval = None + raw_size += len( self.current_line ) break except ParseError, e: handle_parse_error( e ) - continue - finally: raw_size += len( self.current_line ) + continue + # TODO: When no longer supporting python 2.4 use finally: + #finally: + #raw_size += len( self.current_line ) # If interval not associated with feature, break. group = interval.attributes.get( 'group', None )