Commit Graph

446 Commits

Author SHA1 Message Date
Marc-André Lemburg e5006ebc9d This patch turns the Python API mismatch notice into a standard
Python warning which can be catched by means of the Python warning
framework.

It also adds two new APIs which hopefully make it easier for Python
to switch to buffer overflow safe [v]snprintf() APIs for error
reporting et al. The two new APIs are PyOS_snprintf() and
PyOS_vsnprintf() and work just like the standard ones in many
C libs. On platforms which have snprintf(), the native APIs are used,
on all other an emulation with snprintf() tries to do its best.
2001-07-31 13:24:44 +00:00
Martin v. Löwis 4f1cd8bdcb Patch #411138: Rename config.h to pyconfig.h. Closes bug #231774. 2001-07-26 13:41:06 +00:00
Neil Schemenauer 7d4bb9f179 Add -E command line switch (ignore environment variables like PYTHONHOME
and PYTHONPATH).
2001-07-23 16:30:27 +00:00
Guido van Rossum e31c2eeb41 Thomas, I don't care about unset either, but setting PYTHONHOME=
doesn't work -- it actually prevents the extensions from being built
properly.  So I'm changing the "sharedmods" target to what I presume
it was before:
	PYTHONPATH= ./$(PYTHON) $(srcdir)/setup.py build
2001-07-19 15:17:52 +00:00
Martin v. Löwis 130fb17578 Patch #418659: Fixes for UnixWare and ReliantUnix.
back-out 1.215 of configure.in and 1.34 of Makefile.pre.in
Check for -Kpthread compiler support, and use this as the sole option
for MT if available.
2001-07-19 11:00:41 +00:00
Thomas Wouters ee6a4a28ce Avoid the use of 'unset', which isn't available on all platforms. Fixes SF
bug #442627.
2001-07-19 09:34:09 +00:00
Jack Jansen c49e5b7386 Added a MACHDEP_OBJS to the python link. Use this on MacOSX to include
Mac/macglue.c into the core interpreter. This file contains the glue code that
allows extension modules for Mac toolboxes to live in different shared libraries
but still communicate with each other. The glue code is controlled by the
USE_MAC_TOOLBOX_GLUE define.
2001-06-19 15:00:23 +00:00
Guido van Rossum 1d88c59f75 Acknowledge the existence of the 'platform' file, generated by the
Makefile and used by the setup.py script.  Ignore it in .cvsignore;
remove it in "make clobber".
2001-06-06 17:51:57 +00:00
Neil Schemenauer 89e90d67aa Separate CFLAGS and CPPFLAGS. CFLAGS should not contain preprocessor
directives, which is the role of CPPFLAGS.  Closes SF patch #414991.
2001-06-02 06:16:02 +00:00
Guido van Rossum 59d1d2b434 Iterators phase 1. This comprises:
new slot tp_iter in type object, plus new flag Py_TPFLAGS_HAVE_ITER
new C API PyObject_GetIter(), calls tp_iter
new builtin iter(), with two forms: iter(obj), and iter(function, sentinel)
new internal object types iterobject and calliterobject
new exception StopIteration
new opcodes for "for" loops, GET_ITER and FOR_ITER (also supported by dis.py)
new magic number for .pyc files
new special method for instances: __iter__() returns an iterator
iteration over dictionaries: "for x in dict" iterates over the keys
iteration over files: "for x in file" iterates over lines

TODO:

documentation
test suite
decide whether to use a different way to spell iter(function, sentinal)
decide whether "for key in dict" is a good idea
use iterators in map/filter/reduce, min/max, and elsewhere (in/not in?)
speed tuning (make next() a slot tp_next???)
2001-04-20 19:13:02 +00:00
Jeremy Hylton 12b6457e24 Fix compileall.py so that it fails on SyntaxErrors
The changes cause compilation failures in any file in the Python
installation lib directory to cause the install to fail.  It looks
like compileall.py intended to behave this way, but a change to
py_compile.py and a separate bug defeated it.

Fixes SF bug #412436

This change affects the test suite, which contains several files that
contain intentional errors.  The solution is to extend compileall.py
with the ability to skip compilation of selected files.

NB compileall.py is changed so that compile_dir() returns success only
if all recursive calls to compile_dir() also check success.
2001-04-18 01:20:21 +00:00
Guido van Rossum cd0ed971f2 Remove shared libraries as part of "make clean" rather than in "make
clobber".  This is done so that after a "make clean", setup.py will
also recompile all extensions.
2001-04-14 17:57:07 +00:00
Guido van Rossum 2242f2fbd0 Unixware 7 support by Billy G. Allie (SF patch 413011) 2001-04-11 20:58:20 +00:00
Neil Schemenauer 3f5cc20813 Use INSTALL_SCRIPT to install script files. INSTALL_PROGRAM may try to
strip them.  Closes patch #406287.
2001-04-10 23:03:35 +00:00
Guido van Rossum 4e6a7a626d Make on Alpha Tru64 5.1 (as installed on the SF compile farm) doesn't
think that a command starting with '#' is a comment, so move the one
comment in such a position (in the rule for building $(LIBRARY)) to a
harmless position.
2001-04-09 22:23:22 +00:00
Neil Schemenauer 64b1b686d1 - Remove WITH makefile variable. Its not used for anything.
- Add CONFIG_ARGS variable and use it to re-run configure rather than
  using config.status.  This prevents an infinite loop if configure
  dies while re-configuring.
2001-03-22 00:32:32 +00:00
Neil Schemenauer cf20d4f5ad Install the Python DLL with execute priviledge set. This is required for
Cygwin Python to startup correctly when in ntsec mode.  Cygwin operating in
this mode is probably not the only system with this requirement.
2001-03-16 11:50:43 +00:00
Fred Drake a1a84e7d4f Move all knowledge that $(MAINOBJ) is built in the Modules/ directory
into Makefile.pre.in; the configure script will only determine the basename
of the file.

This fixes installation of a Python built using C++, reported by Greg
Wilson.
2001-03-06 05:52:16 +00:00
Barry Warsaw 4211925453 Added `memtest' target which excludes the quicktest modules plus
test_dl, test___all__, test_fork1, and test_longexp.  All these either
take way too long with Insure or crash it.
2001-03-03 04:14:21 +00:00
Guido van Rossum cd81ea1708 Use
find $(srcdir)/Lib -name '*.py[co]' -print | xargs rm -f

to remove all .py[co] files before testing, rather than just those in
the Lib/test directory.  "find" is used all over the Makefile so I
suppose it's safe; how about xargs?
2001-03-01 00:36:53 +00:00
Jeremy Hylton 4db62b1e14 Improved __future__ parser; still more to do
Makefile.pre.in: add target future.o

Include/compile.h: define PyFutureFeaters and PyNode_Future()
                   add c_future slot to struct compiling

Include/symtable.h: add st_future slot to struct symtable

Python/future.c: implementation of PyNode_Future()

Python/compile.c: use PyNode_Future() for nested_scopes support

Python/symtable.c: include compile.h to pick up PyFutureFeatures decl
2001-02-27 19:07:02 +00:00
Neil Schemenauer cf9926ca8d Change EXEEXT back to EXE in the Makefile. Other tools may depend on the name.
The name in configure is still EXEEXT because that's what autoconf calls it.
Also, replace a few occurrences of "python" with "$(PYTHON)".
2001-02-27 18:50:56 +00:00
Neil Schemenauer a35c688055 Add Vladimir Marangozov's object allocator. It is disabled by default. This
closes SF patch #401229.
2001-02-27 04:45:05 +00:00
Neil Schemenauer 40417746fa Add missing dependents of graminit.h. 2001-02-27 02:45:36 +00:00
Neil Schemenauer 7cd124c7d2 Generate grammar source files in srcdir. Ignore the error if they cannot
be created (perhaps the source directory is read-only).
2001-02-27 02:19:16 +00:00
Neil Schemenauer c5cfcb4a48 Fix bug in clean target (closes SF patch 103864 and bug 132879). The clobber
target now removes some configure files (like it did before).
2001-02-19 04:35:11 +00:00
Andrew M. Kuchling 0eb24d9328 Set PYTHONPATH when running setup.py in order to override any ambient
value for it, as suggested in bug #129854.  This prevents an old
    PYTHONPATH confusing setup.py (say, if it results in Python finding
    an old version of the Distutils)
2001-02-17 05:33:50 +00:00
Neil Schemenauer 2b2681ac3e Remove confusing explaination about altinstall target and refer to
the README file.
2001-02-16 04:16:34 +00:00
Neil Schemenauer 92538fbf85 Build grammar files in their proper place rather than moving them. This should
allow building with a read-only source tree (although I haven't tried it).
2001-02-16 03:59:53 +00:00
Neil Schemenauer 75e33892f8 Simplify linking on BeOS. Rename some files. Closes SF patch #103679. 2001-02-16 03:36:53 +00:00
Neil Schemenauer 8d3274e053 Specify directory permissions properly. Closes SF patch #103717. 2001-02-10 20:07:38 +00:00
Jeremy Hylton cb17ae8b19 Relax the rules for using 'from ... import *' and exec in the presence
of nested functions.  Either is allowed in a function if it contains
no defs or lambdas or the defs and lambdas it contains have no free
variables.  If a function is itself nested and has free variables,
either is illegal.

Revise the symtable to use a PySymtableEntryObject, which holds all
the revelent information for a scope, rather than using a bunch of
st_cur_XXX pointers in the symtable struct.  The changes simplify the
internal management of the current symtable scope and of the stack.

Added new C source file: Python/symtable.c.  (Does the Windows build
process need to be updated?)

As part of these changes, the initial _symtable module interface
introduced in 2.1a2 is replaced.  A dictionary of
PySymtableEntryObjects are returned.
2001-02-09 22:22:18 +00:00
Neil Schemenauer ac959779f0 Install shared modules enabled by Setup* in $(DESTSHARED) not
$(DESTSHARED)/Modules.
2001-02-06 14:50:27 +00:00
Neil Schemenauer e0d435777c Tweak clean targets yet again. 2001-02-03 17:16:29 +00:00
Jeremy Hylton 96da8b6d88 add compile.h and symtable.h to list of header files 2001-02-02 19:54:23 +00:00
Jeremy Hylton 26d1f14433 Undo recent exclusion of test_fork1 and test_zlib. These tests don't
trigger my arbitrary exlusion rule, which is: takes more than 10
seconds of wall clock time on my machine.  If these tests are going to
be skipped, then a boatload of slower tests should be skipped, too.
2001-02-02 18:12:16 +00:00
Fred Drake 042f3137ba Added fork1, linuxaudiodev, sunaudiodev, and zlib to the tests skipped
by the quicktest target.
2001-02-02 03:03:33 +00:00
Jeremy Hylton 2a850d91bc add quicktest target -- runs test suite except for the eight slowest tests 2001-02-01 19:51:28 +00:00
Andrew M. Kuchling bddd878cd5 Restore the automatic use of the oldsharedmods and oldsharedinstall targets 2001-01-29 20:18:59 +00:00
Sjoerd Mullender 30be8708c5 Don't use $< in normal make rules: it's not portable. Using $< in
inference rules (e.g. .c.o) is fine.
2001-01-29 09:39:14 +00:00
Neil Schemenauer 188218232d - Fix buildno dependencies (I hope).
- Change one last EXE to EXEEXT.
2001-01-27 21:42:38 +00:00
Andrew M. Kuchling 03184e2815 Remaining single-line change from patch #102409: to install shared modules,
run setup.py with the --install-platlib flag so you can override
   'prefix' when running make (e.g. make prefix=/tmp/python/usr/local install)

Instead of using mkdir to create directories, use install -d (mkdir -p
   apparently isn't portable)

Emacs make-mode reported line 371 as suspicious; removed the whitespace from
   that line.
2001-01-26 22:52:45 +00:00
Neil Schemenauer 7ac954b7f6 - Add CFLAGSFORSHARED variable. configure sets this to CCSHARED if LDLIBRARY
is a shared library.
- Add PY_CFLAGS variable (flags used to compile the interpreter)
- clobber now just removes object files, libraries and binaries
2001-01-26 16:14:41 +00:00
Neil Schemenauer f65e500594 Make module objects from Setup depend on Python.h headers. 2001-01-25 20:07:50 +00:00
Jeremy Hylton fbd849f201 PEP 227 implementation
A cell contains a reference to a single PyObject.  It could be
implemented as a mutable, one-element sequence, but the separate type
has less overhead.
2001-01-25 20:04:14 +00:00
Neil Schemenauer 85515ad979 Flat makefile based on toplevel Makefile.in and makefiles in build
subdirectories.  Those other makefiles will go away eventually.
2001-01-24 17:11:43 +00:00