Commit graph

21,786 commits

Author SHA1 Message Date
Jamie Slome
a05fc79310
Update mkdist.py 2021-03-25 06:57:33 +00:00
Raj
d26e0f70d6
Merge pull request #3 from d3v53c/huntr-01
os.system calls migrated to subprocess.call / Popen api calls in Tools/mkdist.py
2020-09-17 16:03:53 +01:00
Mr. Krabbs
ca567a9557 removed destructuring operator for backward compatibililty 2020-09-16 07:29:37 -07:00
Mr. Krabbs
08478798f1 cleanup 2020-09-14 15:18:11 -07:00
Mr. Krabbs
2a4b4ea6e6 changed os system calls to subprocess calls 2020-09-14 14:44:48 -07:00
d3v53c
3bfbab1dae cmd exec using subprocess rather than system calls 2020-09-14 04:28:19 -07:00
Olly Betts
975f8fcfdb Avoid undefined behaviour in DOH Replace() function
If the source and replacement strings were the same length, the code
was performing undefined pointer arithmetic involving a NULL pointer.
I'm not aware of any observable effects of this in practice, but it's
potentially problematic.  It's detected by ubsan, for example when
running `make check-python-test-suite`:

DOH/string.c:839:4: runtime error: applying non-zero offset to non-null pointer 0x602000001558 produced null pointer
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior DOH/string.c:839:4 in
2020-09-04 10:44:49 +12:00
William S Fulton
b018c32f9d Fix crashes in swig_connect_director during director class construction.
Occurs when using the director class from multiple threads - a race condition
initialising block scope static variables.

Block scope static variables are guaranteed to be thread safe in C++11,
so the fix is guaranteed when using C++11. However, most modern compilers
also fix it when using C++03/C++98.

Closes #1862
2020-08-28 18:23:47 +01:00
William S Fulton
70e78d4125 Travis testing of Python 3.9 2020-08-27 20:23:19 +01:00
William S Fulton
e774fe5cfd Python 3.9 support for -builtin
Add missing initializer for member ‘_heaptypeobject::ht_module’ to complete
Python 3.9 support.
2020-08-27 20:22:39 +01:00
William S Fulton
bebb655975 Merge branch 'more-octave-fixes'
* more-octave-fixes:
  Octave: error() must be called with an argument
2020-08-27 19:45:32 +01:00
William S Fulton
9c50887daa Python 3.9 support
Remove PyEval_InitThreads() call for Python 3.7 and later as Python calls
it automatically now. This removes a deprecation warning when using Python 3.9.

https://docs.python.org/3/c-api/init.html#c.PyEval_InitThreads
2020-08-27 19:37:26 +01:00
Karl Wette
251ab662bf Octave: error() must be called with an argument 2020-08-27 17:19:13 +10:00
William S Fulton
01a2d5fe4c
Merge pull request #1861 from adelva1984/no-return-without-have-pcre
naming: Add unreachable return to !HAVE_PCRE path
2020-08-25 21:14:08 +01:00
William S Fulton
b1c0145fd3 Python 3.2 syntax error fixes in tests 2020-08-15 23:51:40 +01:00
William S Fulton
c5e078c437 Revert 2to3 modification
Use sys.maxint still for Python 2
2020-08-15 23:50:31 +01:00
William S Fulton
baec830f75 Merge branch 'remove-dependency-on-2to3'
* remove-dependency-on-2to3:
  Remove need for Python 2to3
  Modify examples to be both Python 2 and 3 compatible
  Remove python3 specific runme3.py test files
  Convert python tests using 2to3
  Convert python test scripts to be Python 2 and 3 compatible
  Convert swigobject python test to be python 2 and 3 compatible
  Convert two tests to work with both Python 2 and 3
  Improve director_exception Python test
  Remove further print statements from Python tests
  Improve Python testing catching exceptions
  Improve contract Python testcase testing
  Remove print statements from Python tests
2020-08-15 19:03:38 +01:00
William S Fulton
cc94e5168f Add missing test to python test-suite 2020-08-15 19:02:52 +01:00
William S Fulton
ec2b47ef2a Remove need for Python 2to3
All Python examples and tests have been written to be both Python 2 and Python 3
compatible, removing the need for 2to3 to run the examples or test-suite.

The 2to3 executable is not always available and even when available does not
always work, e.g. with pyenv. An alternative would be to use the lib2to3 Python
module instead, but this isn't available in some older versions of Python 3.

I had this problem on Ubuntu Bionic on Travis:

  checking Examples/python/callback
  pyenv: 2to3-3.8: command not found
  The `2to3-3.8' command exists in these Python versions:
    3.8
    3.8.1

Reference issues:
  https://github.com/pypa/virtualenv/issues/1399
  https://travis-ci.community/t/2to3-command-not-found-in-venv-in-bionic/4495
2020-08-15 18:04:58 +01:00
William S Fulton
89bee6a7fa Modify examples to be both Python 2 and 3 compatible
For removing dependency on 2to3
2020-08-15 16:46:01 +01:00
William S Fulton
bc7a067587 Remove Examples/contract
This set of examples was never tested/documented
There is an equivalent testcase in Examples/test-suite/contract.i
2020-08-15 12:26:21 +01:00
William S Fulton
2af35cb4ff Remove python3 specific runme3.py test files
This file can be run using Python 2, the test is just ignored
2020-08-15 12:20:23 +01:00
William S Fulton
d4ffa46f41 Convert python tests using 2to3
These tests were converted using 2to3 and should be valid using
Python 2.7 and Python 3+.
2020-08-15 00:16:04 +01:00
William S Fulton
66df0bd224 Convert python test scripts to be Python 2 and 3 compatible
Unicode testing
2020-08-15 00:09:31 +01:00
William S Fulton
36bb54f01d Convert swigobject python test to be python 2 and 3 compatible 2020-08-14 23:27:35 +01:00
William S Fulton
982b08dced Convert two tests to work with both Python 2 and 3
Now these two tests work without having to use 2to3
2020-08-13 23:34:28 +01:00
William S Fulton
d820045336 Improve director_exception Python test
Add code to handle missed exceptons.
Remove print statement.
2020-08-13 22:00:01 +01:00
William S Fulton
9169555628 Remove further print statements from Python tests
Use exceptions instead of printing to stdout.
Part of an effort to convert Python tests to python 3 syntax.
2020-08-13 21:47:20 +01:00
William S Fulton
64d3617b3c Improve Python testing catching exceptions
Catch expected exceptions only
2020-08-13 21:40:11 +01:00
William S Fulton
7c34d3828f Improve contract Python testcase testing
Catch expected exceptions only - fix bug in test
2020-08-13 21:31:56 +01:00
William S Fulton
365d4961d4 Remove print statements from Python tests
Use exceptions instead of printing to stdout.
Part of an effort to convert Python tests to python 3 syntax.
2020-08-13 21:22:47 +01:00
William S Fulton
e535190c34 Update Visual C++ instructions in Windows.html 2020-08-13 20:07:10 +01:00
William S Fulton
f383095851 Alphabetise testing of examples 2020-08-13 20:07:10 +01:00
Alistair Delva
baf2fbb98f naming: Add unreachable return to !HAVE_PCRE path
Android builds all host tools with -Werror=no-return, which generates a
false positive in name_regexmatch_value() if HAVE_PCRE is not present.

Fix this by adding a return code to the !HAVE_PCRE path. This return
will not be reached but will suppress the compiler warning.

If/when SWIG can require C++11 compilers, a better fix would be to make
SWIG_exit() [[noreturn]].

Closes #1860
2020-08-13 09:19:37 -07:00
William S Fulton
143837ddf1 Update changes file 2020-08-13 16:26:50 +01:00
William S Fulton
bfddc50a6a Add C# support for void *VOID_INT_PTR member variables
Issue reported by Carlos Frederico Biscaya on swig-user mailing list.
2020-08-13 16:06:48 +01:00
William S Fulton
a38f30a194 Add basic std::pair Python testing
Based on Ruby's li_std_pair_runme.rb
2020-08-13 16:06:48 +01:00
William S Fulton
46e17f1458
Merge pull request #1843 from chrisburr/patch-1
PyTypeObject::ob_base isn't available in PyPy
2020-07-29 21:49:50 +01:00
Chris Burr
eafe1e2daa
Use Py_TYPE in SwigPyBuiltin_SetMetaType 2020-07-28 08:11:02 +02:00
Chris Burr
917110212e
PyTypeObject::ob_base isn't available in PyPy 2020-07-17 12:15:54 +02:00
William S Fulton
d967e4c8b8 Use conventional 'v' prefix for release tagging
See semantic versioning:
  https://semver.org/spec/v2.0.0.html

Closes #1825
2020-06-23 19:18:58 +01:00
William S Fulton
ce4164b66d Add director comparison operator fix to changes file 2020-06-14 23:09:11 +01:00
William S Fulton
ee7eb6b58a Merge branch 'directors-comparison-operators'
* directors-comparison-operators:
  Use %rename
  Fix wrapping of virtual comparison operators with directors
2020-06-14 22:23:57 +01:00
William S Fulton
09a5b83aac
Merge pull request #1822 from vapier/master
configure: use AC_PATH_TOOL for pkg-config
2020-06-14 10:23:02 +01:00
William S Fulton
4546aae41d Add missing python cygwin build in appveyor.yml 2020-06-13 14:04:50 +01:00
William S Fulton
148f6b48fc Move python cygwin to Appveyor allow_failure list. 2020-06-13 13:56:28 +01:00
Mike Frysinger
e9a21197ec configure: use AC_PATH_TOOL for pkg-config
AC_CHECK_PROGS will find the tool using exactly the name given: it
only searches for "pkg-config".  When doing native builds, this is
generally fine.  However, when cross-compiling, this is not ideal
as `pkg-config` is often configured for the build system, not the
system we want to cross-compile for.

Switch to using the AC_PATH_TOOL tool instead.  This will look for
"pkg-config" with a $host- prefix first before falling back to the
plain "pkg-config".  When doing native builds, things should still
behave the same, but now things work better out of the box when we
cross-compile.

For example, `./configure --host=aarch64-linux-gnu` will first look
for "aarch64-linux-gnu-pkg-config" before falling back to the plain
"pkg-config".
2020-06-12 19:08:29 -04:00
William S Fulton
b94dd4b770 Merge branch 'pyopers-docs'
* pyopers-docs:
  Fix references to pyopers.swg in the Python docs
2020-06-12 23:10:45 +01:00
William S Fulton
23e5362882 Merge branch 'vapier-master'
* vapier-master:
  configure: change $PKGCONFIG to $PKG_CONFIG
2020-06-12 23:09:31 +01:00
William S Fulton
d3fa519a9c Stop running cygwin python test on Appveyor
Currently broken, unable to find header files.
2020-06-12 23:08:00 +01:00