Re: 2.0.4 -> 3.0.12 -> 4.0.1

William S Fulton <[email protected]>
Newsgroups gmane.comp.programming.swig
Message-ID <CANGqftCqy+0SpoOM83vnmTf3gfDG7VTgqfzoNGneL-EGEk37xg@mail.gmail.com>
Hi Bob



On Tue, 21 Apr 2020 at 17:24, Bob Hood <[email protected]> wrote:

> Actually, I found it far easier to just patch SWIG instead of Python:
>
> --- M:/swig-3.0.12/Lib/python/pyrun.swg    Tue Apr 21 10:18:48 2020
> +++ M:/swig-3.0.12/Lib/python/pyrun_patched.swg    Tue Apr 21 10:11:07 2020
> @@ -1362,7 +1362,7 @@
>      }
>    } else {
>  #if PY_VERSION_HEX >= 0x03000000
> -    inst = ((PyTypeObject*) data->newargs)->tp_new((PyTypeObject*)
> data->newargs, Py_None, Py_None);
> +    inst = ((PyTypeObject*) data->newargs)->tp_new((PyTypeObject*)
> data->newargs, PyTuple_New(0), Py_None);
>
> This issue was fixed 18 months ago for swig-4.0.0.


> Enter SWIG 4.0.1.  I decided to try it as a drop-in replacement for
> 3.0.12.  Unfortunately, the import module that it creates does not get the
> formatting correct, leaving indentation errors *all over the module*:
>
>
>
>
>
> So, of course, I cannot even run the system to see if SWIG v4 solves the
> *original* issue found in SWIG v3.
>
> SWIG 4.0.1 does not have any indentation problems that have been reported
and they aren't in the extensive test-suite we have. Where is the comment
code with the indentations coming from? Is it not your own code? Please
provide a small example of the indentation problem and I'll take a look.

There are various bugs fixed in swig-4.0 for python > 3.5, so if you are
using python 3.8, I really would encourage moving to swig-4.0 once we've
sorted the indentation problem out.

William

_______________________________________________
Swig-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/swig-user
2020-04-14_11-29-48.png (image/png, 23.2 KB) - not displayed
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.