Skip to content

Commit b9816f3

Browse files
committed
python modules on Darwin have extension .so, so DTRT
1 parent 49c0b24 commit b9816f3

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

pygccxml/binary_parsers/parsers.py

+4-3
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
import os
1919
import re
2020
import sys
21+
import platform
2122
import ctypes
2223
from . import undname
2324
import warnings
@@ -324,7 +325,7 @@ def __extract_symbols( self, cmd ):
324325
output = self.__execute_nm( cmd )
325326
result = {}
326327
for line in output:
327-
found = self.entry.match( line )
328+
found = self.entry.match( str(line) )
328329
if found:
329330
result[ found.group( 'address' ) ] = found.group( 'symbol' )
330331
return result
@@ -373,10 +374,10 @@ def merge_information( global_ns, fname, runs_under_unittest=False ):
373374
parser = dll_file_parser_t( global_ns, fname )
374375
elif '.map' == ext:
375376
parser = map_file_parser_t( global_ns, fname )
377+
elif '.dylib' == ext or ('.so' == ext and platform.system() == 'Darwin'):
378+
parser = dylib_file_parser_t( global_ns, fname)
376379
elif '.so' == ext or '.so.' in os.path.basename(fname):
377380
parser = so_file_parser_t( global_ns, fname )
378-
elif '.dylib' == ext:
379-
parser = dylib_file_parser_t( global_ns, fname)
380381
else:
381382
raise RuntimeError( "Don't know how to read exported symbols from file '%s'"
382383
% fname )

0 commit comments

Comments
 (0)