[Scons-users] TryRun() problem with python3 scons-3.0.1
Mats Wichmann
mats at wichmann.us
Fri Mar 9 12:16:13 EST 2018
"true"? Darn autocorrect. Put it another way, let's see what is coming back from the calls, before it tips over with a type error.
On March 8, 2018 10:06:24 PM PST, Mats Wichmann <mats at wichmann.us> wrote:
>Try stuffing some debug prints in after the true to see what came back.
>
>On March 8, 2018 10:02:17 PM PST, Dave Plater <dplater.list at gmail.com>
>wrote:
>>
>>
>>On 08/03/18 18:56, Bill Deegan wrote:
>>> Dave,
>>>
>>> Can you run with --debug=stacktrace and share the stacktrace?
>>>
>>> -Bill
>>
>>Running with --debug=stacktrace provides nothing more than when it's
>>not present :
>>Checking for a working C-compiler TypeError : sequence item 0:
>expected
>>
>>str instance, bytes found
>>
>>Thanks,
>>Dave
>>
>>>
>>> On Thu, Mar 8, 2018 at 5:59 AM, Dave Plater <dplater.list at gmail.com
>>> <mailto:dplater.list at gmail.com>> wrote:
>>>
>>> Hi, I'm battling to find why these SConstruct sections fails
>with
>>> "TypeError : sequence item 0: expected str instance, bytes
>found"
>>>
>>> def CompilerCheck( context ):
>>> context.Message( "Checking for a working C-compiler " )
>>> ret = context.TryRun( """
>>> #include <stdio.h>
>>>
>>> int main() {
>>> printf( "Hello World!" );
>>> return 0;
>>> }""", '.c' ).decode('utf-8')[0]
>>> context.Result( ret )
>>>
>>> or
>>>
>>> if 'CFLAGS' in env:
>>> oldcf = env['CFLAGS']
>>> else:
>>> oldcf = ""
>>> env.Append(CFLAGS = '-std=c99')
>>> if conf.CheckLibWithHeader( "m", "math.h", "c",
>>"lrint(3.2);"
>>> ).decode('utf-8'):
>>> HAVE_LRINT = 1
>>> else:
>>> HAVE_LRINT = 0
>>> if conf.CheckLibWithHeader( "m", "math.h", "c",
>>"lrintf(3.2);"
>>> ).decode('utf-8'):
>>> HAVE_LRINTF = 1
>>> else:
>>> HAVE_LRINTF = 0
>>> env['HAVE_LRINT'] = HAVE_LRINT;
>>> env['HAVE_LRINTF'] = HAVE_LRINTF;
>>> env.Replace(CFLAGS=oldcf)
>>>
>>> What am I doing wrong? I've tried suffixing .decode('utf-8')
>>after
>>> the TryRun statement as well.
>>>
>>> Thanks
>>> Dave Plater
>>> _______________________________________________
>>> Scons-users mailing list
>>> Scons-users at scons.org <mailto:Scons-users at scons.org>
>>> https://pairlist4.pair.net/mailman/listinfo/scons-users
>>> <https://pairlist4.pair.net/mailman/listinfo/scons-users>
>>>
>>>
>>>
>>>
>>> _______________________________________________
>>> Scons-users mailing list
>>> Scons-users at scons.org
>>> https://pairlist4.pair.net/mailman/listinfo/scons-users
>>>
>>_______________________________________________
>>Scons-users mailing list
>>Scons-users at scons.org
>>https://pairlist4.pair.net/mailman/listinfo/scons-users
>
>--
>Sent from my Android device with K-9 Mail. Please excuse my brevity.
--
Sent from my Android device with K-9 Mail. Please excuse my brevity.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://pairlist4.pair.net/pipermail/scons-users/attachments/20180309/aa98f9e4/attachment.html>
More information about the Scons-users
mailing list