Skip to content

Commit 336e9b8

Browse files
author
roman_yakovenko
committed
implmenting better algorithm for ctypes builder
1 parent b186224 commit 336e9b8

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

pygccxml/parser/config.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -226,21 +226,21 @@ def load_gccxml_configuration( configuration, **defaults ):
226226
if isinstance( configuration, types.StringTypes ):
227227
from ConfigParser import SafeConfigParser
228228
parser = SafeConfigParser()
229-
parser.readfp( file( configuration, 'r' ) )
229+
parser.read( configuration )
230230
gccxml_cfg = gccxml_configuration_t()
231-
if not parser.has_section( 'gccxml' ):
232-
return gccxml_cfg
233231

234232
values = defaults
235233
if not values:
236234
values = {}
237-
238-
for name, value in parser.items( 'gccxml' ):
239-
if value.strip():
240-
values[ name ] = value
235+
236+
if parser.has_section( 'gccxml' ):
237+
for name, value in parser.items( 'gccxml' ):
238+
if value.strip():
239+
values[ name ] = value
241240

242241
for name, value in values.iteritems():
243-
value = value.strip()
242+
if isinstance( value, types.StringTypes ):
243+
value = value.strip()
244244
if name == 'gccxml_path':
245245
gccxml_cfg.gccxml_path = value
246246
elif name == 'working_directory':

0 commit comments

Comments
 (0)