[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: svn commit: r22625 - in trunk: build/generator subversion/bindings/swig

From: Daniel Rall <dlr_at_collab.net>
Date: 2006-12-12 06:34:14 CET

On Sat, 09 Dec 2006, jerenkrantz@tigris.org wrote:
...
> Auto-detect the Python include and library dirs on Win32 for SWIG's use.
>
> * build/generator/gen_win.py
> (__init__): Discover our Python options.
> (get_win_includes): Add in our Python include directories.
> (get_win_lib_dirs): Add in our Python library directory for Win32.
> (_find_python): Ask distutils.sysconfig where we can find our dirs.
> * subversion/bindings/swig/INSTALL: Update documentation with helpful notes.
...
> --- trunk/build/generator/gen_win.py (original)
> +++ trunk/build/generator/gen_win.py Sat Dec 9 12:52:34 2006
...
> @@ -940,6 +950,21 @@
> finally:
> fp.close()
>
> + def _find_python(self):
> + "Find the appropriate options for creating SWIG-based Python modules"
> + self.python_includes = []
> + self.python_libdir = ""
> + try:
> + from distutils import sysconfig
> + inc = sysconfig.get_python_inc()
> + plat = sysconfig.get_python_inc(plat_specific=1)
> + self.python_includes.append(inc)
> + if inc != plat:
> + self.python_includes.append(plat)
> + self.python_libdir = self.apath(sysconfig.PREFIX, "libs")
> + except ImportError:
> + pass
...

Does the majority of that method need to be in the "try" block
(e.g. because sysconfig API internally may perform import which could
throw ImportError), or does only the "from distutils import sysconfig"
need to be enclosed by it?

  • application/pgp-signature attachment: stored
Received on Tue Dec 12 06:35:45 2006

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.