Commit Graph

273 Commits

Author SHA1 Message Date
Guido van Rossum e59214ed91 call_object: print message before abort() 1994-08-30 08:01:59 +00:00
Guido van Rossum 74e6a118ca * Python/import.c: support *.o/*.so as alternative for
*module.o/*module.so

        * Python/import.c: if initializing a module did not enter the
        module into sys.modules, it may have raised an exception -- don't
        override this exception.

Merged NT changes

        * Python/import.c: add lost NT-specific code back in

Fixed NT changes
1994-08-29 12:54:38 +00:00
Guido van Rossum 14144fcdfd Added delattr() 1994-08-29 12:53:40 +00:00
Guido van Rossum cae027b298 * Python/bltinmodule.c: added tuple() builtin 1994-08-29 12:53:11 +00:00
Guido van Rossum df05ac6dfb Python/bltinmodule.c: mods by Andrew Kuchling to implement
pow(x,y,z) == pow(x,y)%z, but without incurring overflow
1994-08-29 12:52:37 +00:00
Guido van Rossum 2d9518585c * Python/bltinmodule.c (builtin_vars): correct typo in error msg 1994-08-29 12:52:16 +00:00
Guido van Rossum a110aa658b * Python/pythonrun.c (print_error): added INCREF/DECREF pair --
the exception returned by a syntax error (when reported) would
        contain an object with refcnt zero!
MPW changes
1994-08-29 12:50:44 +00:00
Guido van Rossum 4ca6c9db81 * Python/compile.c (com_argdefs, com_arglist): avoid referencing
CHILD(n,i) for i >= NCH(n)
1994-08-29 12:16:12 +00:00
Guido van Rossum 3a24181837 err_clear: clear interpreter stack trace 1994-08-29 12:14:12 +00:00
Guido van Rossum 13836d9e6d add function name to traceback info
MPW fixes
1994-08-29 12:09:58 +00:00
Guido van Rossum ba941eba67 MPW changes 1994-08-29 10:43:12 +00:00
Guido van Rossum 24f4850377 errors.c: clear traceback too.
Makefile.in: remove lib*.a before creating new one.
1994-08-19 15:37:11 +00:00
Guido van Rossum 14aa5da824 version.c is no longer... 1994-08-18 16:03:36 +00:00
Guido van Rossum b6775db241 Merge alpha100 branch back to main trunk 1994-08-01 11:34:53 +00:00
Guido van Rossum abe173a225 Replace intrcheck() by sigcheck() in many places.
In Pythonrun, tirn off SIGPIPE and move signal handlers elsewhere.
In ceval.c, also move locals_2_fast/ fast_2_locals to frameobject.c,
replaced local variable trace by f->f_trace, got rid of unused
mergelocals() and unneeded calls to fast_2_locals, return the variable
name on "fast variable not found", AND use "__call__" method if it
exists to call an inmstance.  Whew!
1994-06-03 15:58:29 +00:00
Guido van Rossum 6f5f8ddeaf Fix waiting for children -- save ppid in pidlist as well. 1994-05-30 13:39:05 +00:00
Guido van Rossum e944da8916 ceval.c: dict of local mapping is now a tuple
compile.c: lists and dictionary in code objects become tuples
import.c: bump MAGIC
thread*.[ch]: added thread_ident() function
version.c: added '++' to version number and bumped date
1994-05-23 12:43:41 +00:00
Guido van Rossum b98b1b3deb Tim's changes; removed some remaining non-functional ifdefs 1994-05-11 08:42:04 +00:00
Guido van Rossum 2c8cb9f3d2 Split thread.c into a number of system-specific files.
Added Tim Peters' pthread version.
1994-05-09 15:12:46 +00:00
Guido van Rossum 871b805a04 New version handles -o<string> same as -o <string> 1994-04-28 12:33:58 +00:00
Guido van Rossum 2508ade19e A getopt.c for your amusement 1994-04-14 14:08:22 +00:00
Guido van Rossum 8e454f3858 Misc changes. 1993-12-24 10:32:14 +00:00
Guido van Rossum be0e9420a1 New files. 1993-12-24 10:32:00 +00:00
Guido van Rossum 7d6aa51b56 * rangeobject.[ch], bltinmodule.c: incorporate new version of range
object (unchanged from source except "range" -> "xrange").
1993-12-21 22:50:31 +00:00
Guido van Rossum b898bd29b0 New file 1993-12-20 10:43:53 +00:00
Guido van Rossum 67a5fdbcc2 * mpzmodule.c: cast some methods to the proper type.
* traceback.c (tb_print): use sys.tracebacklimit as a maximum number of
  traceback entries to print (default 1000).
* ceval.c (printtraceback): Don't print stack trace header -- this is now
  done by tb_print().
1993-12-17 12:09:14 +00:00
Sjoerd Mullender 66bca326cb Port to Solaris 2.3. 1993-12-03 16:54:45 +00:00
Guido van Rossum 57531fea90 change syntactical position of lambdef (was an atom, now is a test) 1993-11-30 14:57:42 +00:00
Guido van Rossum 590baa4a7a * import.c (get_module): pass .py filename to parse_file, not .pyc filename!
* funcobject.c (func_repr): don't call getstringvalue(None) for anonymous
  functions.
* bltinmodule.c: removed lambda (which is now a built-in function);
  removed implied lambda for string arg to filter/map/reduce.
* Grammar, graminit.[ch], compile.[ch]: replaced lambda as built-in
  function by lambda as grammar entity: instead of "lambda('x: x+1')" you
  write "lambda x: x+1".
* Xtmodule.c (checkargdict): return 0, not NULL, for error.
1993-11-30 13:40:46 +00:00
Guido van Rossum b376a4ad18 * timemodule.c: Add hack for Solaris 2.
* posixmodule.c: don't prototype getcwd() -- it's not portable...
* mappingobject.c: double-check validity of last_name_char in
  dict{lookup,insert,remove}.
* arraymodule.c: need memmove only for non-STDC Suns.
* Makefile: comment out HTML_LIBS and XT_USE by default
* pythonmain.c: don't prototype getopt() -- it's not standardized
* socketmodule.c: cast flags arg to {get,set}sockopt() and addrbuf arg to
  recvfrom() to (ANY*).
* pythonrun.c (initsigs): fix prototype, make it static
* intobject.c (LONG_BIT): only #define it if not already defined
* classobject.[ch]: remove all references to unused instance_convert()
* mappingobject.c (getmappingsize): Don't return NULL in int function.
1993-11-23 17:53:17 +00:00
Guido van Rossum c45611d0e3 * import.c (get_module): total rewrite, to ensure proper search order: for
each dir in sys.path, try each possible extension.  (Note: C extensions
  are loaded before Python modules in the same directory, to allow having
  a C version used when dynamic loading is supported and a Python version
  as a back-up.)
* import.c (reload_module): test for error from getmodulename()
* moduleobject.c: implement module name as dict entry '__name__' instead
  of special-casing it in module_getattr(); this way a module (or
  function!) can access its own module name, and programs that know what
  they are doing can rename modules.
* stdwinmodule.c (initstdwin): strip ".py" suffix of argv[0].
1993-11-17 22:58:56 +00:00
Guido van Rossum a3d78fb268 * posixmodule.c: added set{uid,gid}.
* {tuple,list,mapping,array}object.c: call printobject with 0 for flags
* compile.c (parsestr): use quote instead of '\'' at one crucial point
* arraymodule.c (array_getattr): Added __members__ attribute
1993-11-10 09:23:53 +00:00
Guido van Rossum c600411755 * mpzmodule.c: removed redundant mpz_print function.
* object.[ch], bltinmodule.c, fileobject.c: changed str() to call
  strobject() which calls an object's __str__ method if it has one.
  strobject() is also called by writeobject() when PRINT_RAW is passed.
* ceval.c: rationalize code for PRINT_ITEM (no change in function!)
* funcobject.c, codeobject.c: added compare and hash functionality.
  Functions with identical code objects and the same global dictionary are
  equal.  Code objects are equal when their code, constants list and names
  list are identical (i.e. the filename and code name don't count).
  (hash doesn't work yet since the constants are in a list and lists can't
  be hashed -- suppose this should really be done with a tuple now we have
  resizetuple!)
1993-11-05 10:22:19 +00:00
Guido van Rossum 2e8f8a398e Added compare operations for functions and code objects.
(Also hash, but it doesn't work yet.)
1993-11-05 10:20:10 +00:00
Guido van Rossum 094885b0f0 Must initialize 'inspect' flag 1993-11-05 10:16:09 +00:00
Guido van Rossum e77a757094 * nismodule.c: database keys and values can contain null bytes. be more
careful about these.
* arraymodule.c: added 8 byte swap; added 'i' format character; added
  reverse() method; rename read/write to fromfile/tofile.
* config.c: Set version to 0.9.9++.
* rotormodule.c (r_rand): declare k1..k5 as unsigned longs so the shifts
  will have a well-defined effect independent of word size.
* bltinmodule.c: renamed bagof() to filter().
1993-11-03 15:01:26 +00:00
Guido van Rossum b73cc04e62 * ceval.c, longobject.c, methodobject.c, listnode.c, arraymodule.c,
pythonrun.c: added static forward declarations
* pythonrun.h, ceval.h, longobject.h, node.h: removed declarations of
  static routines
1993-11-01 16:28:59 +00:00
Guido van Rossum 2586bf0a34 * rangeobject.{c,h}, bltinmodule.c: removed non-essential ops from range
object.
1993-11-01 16:21:44 +00:00
Sjoerd Mullender 615194a352 Fixed bugs in resizetuple and extended the interface.
Added ifdefs in stringobject.c for shared strings of length 1.
Renamed free_list in tupleobject.c to free_tuples.
1993-11-01 13:46:50 +00:00
Guido van Rossum dc4b93db70 * listobject.c (list_ass_slice): XDECREF instead of DECREF so
setlistslice() can be used to cut the unused part out of a freshly made
  slice (as done by bagof()).  [needed by the next mod!]
* structural changes to bagof(), map() etc.
1993-10-27 14:56:44 +00:00
Guido van Rossum 3b716046a0 Committing the correct graminit.c; also changed confusing comments in Grammar. 1993-10-27 13:25:30 +00:00
Guido van Rossum 12d12c5faf * compile.[ch]: support for lambda()
* PROTO.h, mymalloc.h: added #ifdefs for TURBOC and GNUC.
* allobjects.h: added #include "rangeobject.h"
* Grammar: added lambda_input; relaxed syntax for exec.
* bltinmodule.c: added bagof, map, reduce, lambda, xrange.
* tupleobject.[ch]: added resizetuple().
* rangeobject.[ch]: new object type to speed up range operations (not
  convinced this is needed!!!)
1993-10-26 17:58:25 +00:00
Guido van Rossum 8054fad890 Changes to accept double-quoted strings on input. 1993-10-26 15:19:44 +00:00
Guido van Rossum 5a2a683e72 * filemodule.c: added writelines() -- analogous to readlines()
* import.c: fixed core dump when out-of-date .pyc file encountered (again!)
1993-10-25 09:59:04 +00:00
Sjoerd Mullender 52c1f51554 import.c: When something is wrong with the .pyc, properly open the .py
file.
object.c: Write allocation statistics to stderr.
1993-10-25 08:40:52 +00:00
Guido van Rossum 89b3325dc4 * import.c (MAGIC): Changed magic word to avoid confusion about exec
function vs. exec statement
* bltinmodule.c: renamed the module to __builtin__.
* posixmodule.c (posix_execv): renamed exec --> execv since it is now a
  reserved word.
1993-10-22 14:26:06 +00:00
Sjoerd Mullender 3bb8a05947 Several optimizations and speed improvements.
cstubs: Use Matrix type instead of float[4][4].
1993-10-22 12:04:32 +00:00
Guido van Rossum db3165e655 * bltinmodule.c: removed exec() built-in function.
* Grammar: add exec statement; allow testlist in expr statement.
* ceval.c, compile.c, opcode.h: support exec statement;
  avoid optimizing locals when it is used
* fileobject.{c,h}: add getfilename() internal function.
1993-10-18 17:06:59 +00:00
Guido van Rossum cacd9579d4 * stdwinmodule.c (stdwin_done): interface to shutdown stdwin (now this is
no longer done by config.c).
* stdwinmodule.c (initstdwin), config.c (initall): get command line
  arguments from sys.argv instead of special-casing stdwin in config.c
* import.c (get_module): fix core dump when foomodule.o does not define
  initfoo().
* ChangeLog: documented changes by Sjoerd.
1993-10-18 11:44:47 +00:00
Guido van Rossum 21d335ed9e Makefile, import.c: Lance's alternative module search (allow .pyc file
without .py file); Bill's dynamic loading for SunOS using shared
libraries.

pwdmodule.c (mkgrent): remove DECREF of uninitialized variable.

classobject.c (instance_getattr): Fix case when class lookup returns
unbound method instead of function.
1993-10-15 13:01:11 +00:00