Hi, > http://hg.python.org/cpython/rev/7582a78f573b > branch: 3.1 > user: Barry Warsaw <barry at python.org> > summary: > Issue 11715: Build extension modules on multiarch Debian and Ubuntu > by > extending search paths to include multiarch directories. > > diff --git a/setup.py b/setup.py > + if not os.path.exists(self.build_temp): > + os.makedirs(self.build_temp) Isn’t there a possible raise condition here? I think it’s recommended to follow EAFP for mkdir and makedirs. > + ret = os.system( > + 'dpkg-architecture -qDEB_HOST_MULTIARCH > %s 2> > /dev/null' % > + tmpfile) > + try: > + if ret >> 8 == 0: > + with open(tmpfile) as fp: > + multiarch_path_component = fp.readline().strip() > + add_dir_to_list(self.compiler.library_dirs, > + '/usr/lib/' + > multiarch_path_component) > + add_dir_to_list(self.compiler.include_dirs, > + '/usr/include/' + > multiarch_path_component) > + finally: > + os.unlink(tmpfile) Is there a benefit in creating and reading a file rather than catching stdout? Regards
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4