Commit graph

13 commits

Author SHA1 Message Date
luz paz
c8bec18554 Fix various typos
Found via `codespell -q 3 -L ans,anumber,ba,bae,chello,clos,cmo,coo,dout,fo,funktion,goin,inout,methid,nd,nin,nnumber,object,objekt,od,ois,packag,parm,parms,pres,statics,strack,struc,tempdate,te,thru,uint,upto,writen`
2022-04-11 07:59:36 +12: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
ff93f2e26e Skip Python subprocess calls in import_packages testcase on Windows
Getting these kind of errors on Appveyor which uses mingw/cygwin to run
a Python interpreter:

Native windows Python 3.6 running under cygwin and mingw Python 3.7 running under mingw:
  Fatal Python error: _Py_HashRandomization_Init: failed to get random
  numbers to initialize Python

Cygwin Python 2.7 running under cygwin:
  0 [main] python2.7 496 child_info_fork::abort: address space needed by '_foo.dll' (0x6D0000)
  is already occupied
2018-12-06 06:50:57 +00:00
William S Fulton
604ae7186b Fix for running 'python -m' when using swig -builtin
Same as e05b5ea for -builtin.

Also added runtime tests to check 'python -m'.
2018-12-04 19:12:13 +00:00
Olly Betts
728b8955bd Drop support for Python classic classes
There were only needed to support Python < 2.2, and we now require at
least Python 2.6.

 Conflicts:
	.travis.yml
	Examples/test-suite/python/autodoc_runme.py
	Source/Modules/python.cxx

This is a cherry-pick and merge from patch in #1261
2018-10-12 07:10:47 +01:00
Alec Cooper
acbe04b548 Support checking names of old-style classic classes 2016-02-04 15:27:54 -05:00
William S Fulton
8e2bc595c6 Remove use of preinst-swig script
Complete the prototype removal in ca1431.

The script prevents SWIGTOOL=gdb from working as gdb can't be used to
debug a shell script, it requires a binary.

Add support for SWIGTOOL in all the examples.

SWIG_LIB_DIR and SWIGEXE must now instead be set by all Makefiles.

See issue #473.
2015-08-21 22:43:17 +01:00
William S Fulton
4ef3507e8b Remove realpath from python/import_packages example 2015-08-20 06:19:12 +01:00
Jon Schlueter
7770715457 autopep8 cleanup of Examples/python whitespace
automated cleanup only of the Examples/python example code
2015-05-08 08:46:06 -04:00
William S Fulton
a9c6196f71 Display testname when running the import_packages Python examples
For easier identification of what is running in these examples.
2014-10-07 20:58:40 +01:00
Karl Wette
f574a34155 Allow examples and test-suite to be built out of source tree
- Examples/Makefile.in rules use SRCDIR as the relative source directory

- ./config.status replicates Examples/ source directory tree in build
  directory, and copies each Makefile to build directory, prefixed with
  a header which sets SRCDIR to source directory

- Examples/test-suite/.../Makefile.in set SRCDIR from Autoconf-set srcdir

- Examples/test-suite/errors/Makefile.in needs to filter out source
  directory from SWIG error messages

- Lua: embedded interpreters are passed location of run-time test

- Python: copy run-time scripts to build directory because of 2to3
  conversion; import_packages example copies __init__.py from source
  directory; test-suite sets SCRIPTDIR to location of run-time tests

- Javascript: binding.gyp renamed to binding.gyp.in so that $srcdir
  can be substituted with SRCDIR; removed './' from require() statements
  so that NODE_PATH can be used to point Node.js to build directory
2014-05-11 23:21:10 +02:00
William S Fulton
4fb940d913 Further fixes when using type() when using -builtin to include module name
Using type() on a builtin type should include the package and module
name, see http://docs.python.org/2/c-api/typeobj.html
2014-03-01 23:26:27 +00:00
Paweł Tomulik
5562deec62 Fixed SF bug #1297 (Python imports)
This changeset resolves several issues related to python imports.
For example, it's possible now to import modules having same module
names, but belonging to different packages.

From the user's viewpoint, this patch gives a little bit more control on
import directives generated by swig. The user may choose to use relative
or absolute imports (docs are provided in separate PR).

Some details:
  - we (still) generate import directives in form 'import a.b.c' which
    corresponds to absolute imports in python3 and (the only available)
    ambiguous one in python2.
  - added -relativeimport option to use explicit relative import syntax
    (python3),

Tests are under Examples/python, these are in fact regression tests but
with the current swig testing framework it seems to be impossible to put
appropriate tests under test-suite.

Closes #7
2013-12-24 17:22:25 +00:00