Cross-platform way to get default directory for binary files like console scripts?

Oscar Benjamin oscar.j.benjamin at gmail.com
Thu Feb 20 16:55:41 CET 2014


On 20 February 2014 15:42, Ned Batchelder <ned at nedbatchelder.com> wrote:
>
> As roundabout and advanced as that code is, it doesn't give the right answer
> for me.  It returns None.  On my Mac, after activating a virtualenv:
>
>     Python 2.7.2 (default, Oct 11 2012, 20:14:37)
>     [GCC 4.2.1 Compatible Apple Clang 4.0 (tags/Apple/clang-418.0.60)] on
> darwin
>     Type "help", "copyright", "credits" or "license" for more information.
>     >>> from distutils.command.install import install
>     >>> from distutils.dist import Distribution
>     >>> c = install(Distribution())

You forgot to call  c.finalize_options() here which actually sets all
of these attributes.

>     >>> c.install_scripts
>     >>> c.install_scripts is None
>     True


Oscar



More information about the Python-list mailing list