[Python-checkins] CVS: python/dist/src/Python atof.c,2.7,2.7.8.1 bltinmodule.c,2.198.2.9,2.198.2.10 fmod.c,2.13,2.13.8.1 frozenmain.c,2.25,2.25.8.1 getmtime.c,2.16,2.16.6.1 hypot.c,2.3,2.3.8.1 import.c,2.176.2.3,2.176.2.4 pyfpe.c,2.6,2.6.8.1 pythonrun.c,2.133.4.5,2.133.4.6 strtod.c,1.10,1.10.8.1 sysmodule.c,2.85.4.2,2.85.4.3 thread.c,2.36,2.36.8.1

Tim Peters tim_one@users.sourceforge.net
Fri, 27 Jul 2001 22:03:02 -0700


Update of /cvsroot/python/python/dist/src/Python
In directory usw-pr-cvs1:/tmp/cvs-serv14630/descr/dist/src/Python

Modified Files:
      Tag: descr-branch
	atof.c bltinmodule.c fmod.c frozenmain.c getmtime.c hypot.c 
	import.c pyfpe.c pythonrun.c strtod.c sysmodule.c thread.c 
Log Message:
Merge of trunk tags date2001-07-21 to date2001-07-28.


Index: atof.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Python/atof.c,v
retrieving revision 2.7
retrieving revision 2.7.8.1
diff -C2 -d -r2.7 -r2.7.8.1
*** atof.c	2000/09/01 23:29:28	2.7
--- atof.c	2001/07/28 05:03:00	2.7.8.1
***************
*** 5,9 ****
     But it's good enough for the occasional string literal... */
  
! #include "config.h"
  
  #include <ctype.h>
--- 5,9 ----
     But it's good enough for the occasional string literal... */
  
! #include "pyconfig.h"
  
  #include <ctype.h>

Index: bltinmodule.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Python/bltinmodule.c,v
retrieving revision 2.198.2.9
retrieving revision 2.198.2.10
diff -C2 -d -r2.198.2.9 -r2.198.2.10
*** bltinmodule.c	2001/07/16 21:42:46	2.198.2.9
--- bltinmodule.c	2001/07/28 05:03:00	2.198.2.10
***************
*** 294,302 ****
  		return NULL;
  
  	if (x < 0 || x > 0x10ffff) {
  		PyErr_SetString(PyExc_ValueError,
! 				"unichr() arg not in range(0x110000)");
  		return NULL;
  	}
  
  	if (x <= 0xffff) {
--- 294,312 ----
  		return NULL;
  
+ #ifdef Py_UNICODE_WIDE
  	if (x < 0 || x > 0x10ffff) {
  		PyErr_SetString(PyExc_ValueError,
! 				"unichr() arg not in range(0x110000) "
! 				"(wide Python build)");
! 		return NULL;
! 	}
! #else
! 	if (x < 0 || x > 0xffff) {
! 		PyErr_SetString(PyExc_ValueError,
! 				"unichr() arg not in range(0x10000) "
! 				"(narrow Python build)");
  		return NULL;
  	}
+ #endif
  
  	if (x <= 0xffff) {

Index: fmod.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Python/fmod.c,v
retrieving revision 2.13
retrieving revision 2.13.8.1
diff -C2 -d -r2.13 -r2.13.8.1
*** fmod.c	2000/09/01 23:29:28	2.13
--- fmod.c	2001/07/28 05:03:00	2.13.8.1
***************
*** 2,6 ****
  /* Portable fmod(x, y) implementation for systems that don't have it */
  
! #include "config.h"
  
  #include "pyport.h"
--- 2,6 ----
  /* Portable fmod(x, y) implementation for systems that don't have it */
  
! #include "pyconfig.h"
  
  #include "pyport.h"

Index: frozenmain.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Python/frozenmain.c,v
retrieving revision 2.25
retrieving revision 2.25.8.1
diff -C2 -d -r2.25 -r2.25.8.1
*** frozenmain.c	2000/09/01 23:29:28	2.25
--- frozenmain.c	2001/07/28 05:03:00	2.25.8.1
***************
*** 31,37 ****
  	Py_FrozenFlag = 1; /* Suppress errors from getpath.c */
  
! 	if ((p = getenv("PYTHONINSPECT")) && *p != '\0')
  		inspect = 1;
! 	if ((p = getenv("PYTHONUNBUFFERED")) && *p != '\0')
  		unbuffered = 1;
  
--- 31,37 ----
  	Py_FrozenFlag = 1; /* Suppress errors from getpath.c */
  
! 	if ((p = Py_GETENV("PYTHONINSPECT")) && *p != '\0')
  		inspect = 1;
! 	if ((p = Py_GETENV("PYTHONUNBUFFERED")) && *p != '\0')
  		unbuffered = 1;
  

Index: getmtime.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Python/getmtime.c,v
retrieving revision 2.16
retrieving revision 2.16.6.1
diff -C2 -d -r2.16 -r2.16.6.1
*** getmtime.c	2001/01/18 03:03:16	2.16
--- getmtime.c	2001/07/28 05:03:00	2.16.6.1
***************
*** 5,9 ****
  
  #include "Python.h"
! #include "config.h"
  
  time_t
--- 5,9 ----
  
  #include "Python.h"
! #include "pyconfig.h"
  
  time_t

Index: hypot.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Python/hypot.c,v
retrieving revision 2.3
retrieving revision 2.3.8.1
diff -C2 -d -r2.3 -r2.3.8.1
*** hypot.c	2000/07/31 15:28:04	2.3
--- hypot.c	2001/07/28 05:03:00	2.3.8.1
***************
*** 1,5 ****
  /* hypot() replacement */
  
! #include "config.h"
  #include "pyport.h"
  
--- 1,5 ----
  /* hypot() replacement */
  
! #include "pyconfig.h"
  #include "pyport.h"
  

Index: import.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Python/import.c,v
retrieving revision 2.176.2.3
retrieving revision 2.176.2.4
diff -C2 -d -r2.176.2.3 -r2.176.2.4
*** import.c	2001/07/17 16:08:57	2.176.2.3
--- import.c	2001/07/28 05:03:00	2.176.2.4
***************
*** 1070,1074 ****
  #endif
  
! 	if (getenv("PYTHONCASEOK") != NULL)
  		return 1;
  
--- 1070,1074 ----
  #endif
  
! 	if (Py_GETENV("PYTHONCASEOK") != NULL)
  		return 1;
  
***************
*** 1093,1097 ****
  	int done;
  
! 	if (getenv("PYTHONCASEOK") != NULL)
  		return 1;
  
--- 1093,1097 ----
  	int done;
  
! 	if (Py_GETENV("PYTHONCASEOK") != NULL)
  		return 1;
  
***************
*** 1110,1114 ****
  	OSErr err;
  
! 	if (getenv("PYTHONCASEOK") != NULL)
  		return 1;
  
--- 1110,1114 ----
  	OSErr err;
  
! 	if (Py_GETENV("PYTHONCASEOK") != NULL)
  		return 1;
  
***************
*** 1148,1152 ****
  	const int dirlen = len - namelen - 1; /* don't want trailing SEP */
  
! 	if (getenv("PYTHONCASEOK") != NULL)
  		return 1;
  
--- 1148,1152 ----
  	const int dirlen = len - namelen - 1; /* don't want trailing SEP */
  
! 	if (Py_GETENV("PYTHONCASEOK") != NULL)
  		return 1;
  
***************
*** 1790,1794 ****
  {
  	PyObject *modules = PyImport_GetModuleDict();
! 	PyObject *m;
  
  	/* Require:
--- 1790,1794 ----
  {
  	PyObject *modules = PyImport_GetModuleDict();
! 	PyObject *m, *res = NULL;
  
  	/* Require:
***************
*** 1830,1836 ****
  		if (fp)
  			fclose(fp);
! 		if (m != NULL && mod != Py_None) {
! 			if (PyObject_SetAttrString(mod, subname, m) < 0) {
! 				Py_DECREF(m);
  				m = NULL;
  			}
--- 1830,1848 ----
  		if (fp)
  			fclose(fp);
! 		if (mod != Py_None) {
! 			/* Irrespective of the success of this load, make a
! 			   reference to it in the parent package module.
! 			   A copy gets saved in the modules dictionary
! 			   under the full name, so get a reference from
! 			   there, if need be.  (The exception is when
! 			   the load failed with a SyntaxError -- then
! 			   there's no trace in sys.modules.  In that case,
! 			   of course, do nothing extra.) */
! 			res = m;
! 			if (res == NULL)
! 				res = PyDict_GetItemString(modules, fullname);
! 			if (res != NULL &&
! 			    PyObject_SetAttrString(mod, subname, res) < 0) {
! 				Py_XDECREF(m);
  				m = NULL;
  			}

Index: pyfpe.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Python/pyfpe.c,v
retrieving revision 2.6
retrieving revision 2.6.8.1
diff -C2 -d -r2.6 -r2.6.8.1
*** pyfpe.c	2000/07/22 18:47:25	2.6
--- pyfpe.c	2001/07/28 05:03:00	2.6.8.1
***************
*** 1,3 ****
! #include "config.h"
  #include "pyfpe.h"
  /* 
--- 1,3 ----
! #include "pyconfig.h"
  #include "pyfpe.h"
  /* 

Index: pythonrun.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Python/pythonrun.c,v
retrieving revision 2.133.4.5
retrieving revision 2.133.4.6
diff -C2 -d -r2.133.4.5 -r2.133.4.6
*** pythonrun.c	2001/07/16 21:42:47	2.133.4.5
--- pythonrun.c	2001/07/28 05:03:00	2.133.4.6
***************
*** 64,67 ****
--- 64,68 ----
  int Py_FrozenFlag; /* Needed by getpath.c */
  int Py_UnicodeFlag = 0; /* Needed by compile.c */
+ int Py_IgnoreEnvironmentFlag; /* e.g. PYTHONPATH, PYTHONHOME */
  
  static int initialized = 0;
***************
*** 99,107 ****
  	initialized = 1;
  	
! 	if ((p = getenv("PYTHONDEBUG")) && *p != '\0')
  		Py_DebugFlag = Py_DebugFlag ? Py_DebugFlag : 1;
! 	if ((p = getenv("PYTHONVERBOSE")) && *p != '\0')
  		Py_VerboseFlag = Py_VerboseFlag ? Py_VerboseFlag : 1;
! 	if ((p = getenv("PYTHONOPTIMIZE")) && *p != '\0')
  		Py_OptimizeFlag = Py_OptimizeFlag ? Py_OptimizeFlag : 1;
  
--- 100,108 ----
  	initialized = 1;
  	
! 	if ((p = Py_GETENV("PYTHONDEBUG")) && *p != '\0')
  		Py_DebugFlag = Py_DebugFlag ? Py_DebugFlag : 1;
! 	if ((p = Py_GETENV("PYTHONVERBOSE")) && *p != '\0')
  		Py_VerboseFlag = Py_VerboseFlag ? Py_VerboseFlag : 1;
! 	if ((p = Py_GETENV("PYTHONOPTIMIZE")) && *p != '\0')
  		Py_OptimizeFlag = Py_OptimizeFlag ? Py_OptimizeFlag : 1;
  
***************
*** 229,233 ****
  	if (
  #ifdef MS_WINDOWS /* Only ask on Windows if env var set */
! 	    getenv("PYTHONDUMPREFS") &&
  #endif /* MS_WINDOWS */
  	    _Py_AskYesNo("Print left references?")) {
--- 230,234 ----
  	if (
  #ifdef MS_WINDOWS /* Only ask on Windows if env var set */
! 	    Py_GETENV("PYTHONDUMPREFS") &&
  #endif /* MS_WINDOWS */
  	    _Py_AskYesNo("Print left references?")) {
***************
*** 398,403 ****
  {
  	char *home = default_home;
! 	if (home == NULL)
! 		home = getenv("PYTHONHOME");
  	return home;
  }
--- 399,404 ----
  {
  	char *home = default_home;
! 	if (home == NULL && !Py_IgnoreEnvironmentFlag)
! 		home = Py_GETENV("PYTHONHOME");
  	return home;
  }

Index: strtod.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Python/strtod.c,v
retrieving revision 1.10
retrieving revision 1.10.8.1
diff -C2 -d -r1.10 -r1.10.8.1
*** strtod.c	2000/07/22 18:47:25	1.10
--- strtod.c	2001/07/28 05:03:00	1.10.8.1
***************
*** 1,3 ****
! #include "config.h"
  
  /* comp.sources.misc strtod(), as posted in comp.lang.tcl,
--- 1,3 ----
! #include "pyconfig.h"
  
  /* comp.sources.misc strtod(), as posted in comp.lang.tcl,

Index: sysmodule.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Python/sysmodule.c,v
retrieving revision 2.85.4.2
retrieving revision 2.85.4.3
diff -C2 -d -r2.85.4.2 -r2.85.4.3
*** sysmodule.c	2001/07/21 06:07:14	2.85.4.2
--- sysmodule.c	2001/07/28 05:03:00	2.85.4.3
***************
*** 76,79 ****
--- 76,84 ----
  	PyObject *builtins = PyDict_GetItemString(modules, "__builtin__");
  
+ 	if (builtins == NULL) {
+ 		PyErr_SetString(PyExc_RuntimeError, "lost __builtin__");
+ 		return NULL;
+ 	}
+ 
  	/* parse arguments */
  	if (!PyArg_ParseTuple(args, "O:displayhook", &o))

Index: thread.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Python/thread.c,v
retrieving revision 2.36
retrieving revision 2.36.8.1
diff -C2 -d -r2.36 -r2.36.8.1
*** thread.c	2000/10/06 15:48:38	2.36
--- thread.c	2001/07/28 05:03:00	2.36.8.1
***************
*** 6,12 ****
     Stuff shared by all thread_*.h files is collected here. */
  
! #include "config.h"
  
! /* config.h may or may not define DL_IMPORT */
  #ifndef DL_IMPORT	/* declarations for DLL import/export */
  #define DL_IMPORT(RTYPE) RTYPE
--- 6,12 ----
     Stuff shared by all thread_*.h files is collected here. */
  
! #include "pyconfig.h"
  
! /* pyconfig.h may or may not define DL_IMPORT */
  #ifndef DL_IMPORT	/* declarations for DLL import/export */
  #define DL_IMPORT(RTYPE) RTYPE