[gdal-dev] testsuite question

Ben Elliston ben.elliston at anu.edu.au
Sun Apr 22 18:54:25 PDT 2018


Hi Even

The testsuite has numerous instances like this:

    if version_info >= (3, 0, 0):
        for i in range(100000):
            exec("f.write(b'\\xa0\\x86\\x01\\x00\\x00\\x00\\x00\\x00')")
    else:
        for i in range(100000):
            f.write('\xa0\x86\x01\x00\x00\x00\x00\x00')

Why is it necessary on Python 3 to use exec() in this way?  It seems
very complicated and counterintuitive.

Thanks, Ben


More information about the gdal-dev mailing list