[Scons-users] SCons, Python 3, and pathlib

Bill Deegan bill at baddogconsulting.com
Tue Jul 25 11:43:19 EDT 2017


dir('.').abspath ?

On Tue, Jul 25, 2017 at 8:39 AM, Russel Winder <russel at winder.org.uk> wrote:

> On Tue, 2017-07-25 at 07:45 -0700, Bill Deegan wrote:
> > SCons is py2 + py3, so we cannot use pathlib in the core.
>
> Agreed, I was thinking of in my SConstruct file as I know I will not be
> using the evil Python 2. ;-)
>
> > Which file are you trying to find the path of?
> > The SConstruct file?
> > Some other file?
>
> The SConstruct file.
>
> pathlib.Path() in a SConstruct delivers '.' but this resolves to the
> current directory of the execution of the PVM and not the actual
> location of the file. To achieve that in a Python script one usually
> uses __file__, however this special variable is not available in a
> SConstruct file during a run of SCons.
>
> --
> Russel.
> ============================================================
> =================
> Dr Russel Winder      t: +44 20 7585 2200   voip:
> sip:russel.winder at ekiga.net
> 41 Buckmaster Road    m: +44 7770 465 077   xmpp: russel at winder.org.uk
> London SW11 1EN, UK   w: www.russel.org.uk  skype: russel_winder
>
> _______________________________________________
> Scons-users mailing list
> Scons-users at scons.org
> https://pairlist4.pair.net/mailman/listinfo/scons-users
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://pairlist4.pair.net/pipermail/scons-users/attachments/20170725/0403785f/attachment-0001.html>


More information about the Scons-users mailing list