mirror of https://github.com/python/cpython
Keep MS compiler happy: use (int)strlen() when comparing; make sure
not to use kill().
This commit is contained in:
parent
b819914263
commit
478e718aca
|
@ -57,6 +57,12 @@ PERFORMANCE OF THIS SOFTWARE.
|
||||||
#include "windows.h"
|
#include "windows.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef HAVE_GETPID
|
||||||
|
#ifndef MS_WINDOWS
|
||||||
|
#define HAVE_KILL
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
extern char *Py_GetPath();
|
extern char *Py_GetPath();
|
||||||
|
|
||||||
extern grammar _PyParser_Grammar; /* From graminit.c */
|
extern grammar _PyParser_Grammar; /* From graminit.c */
|
||||||
|
@ -370,7 +376,7 @@ PyErr_Print()
|
||||||
if (text != NULL) {
|
if (text != NULL) {
|
||||||
char *nl;
|
char *nl;
|
||||||
if (offset > 0 &&
|
if (offset > 0 &&
|
||||||
offset == strlen(text))
|
offset == (int)strlen(text))
|
||||||
offset--;
|
offset--;
|
||||||
for (;;) {
|
for (;;) {
|
||||||
nl = strchr(text, '\n');
|
nl = strchr(text, '\n');
|
||||||
|
@ -728,7 +734,7 @@ sighandler(sig)
|
||||||
{
|
{
|
||||||
signal(sig, SIG_DFL); /* Don't catch recursive signals */
|
signal(sig, SIG_DFL); /* Don't catch recursive signals */
|
||||||
Py_Cleanup(); /* Do essential clean-up */
|
Py_Cleanup(); /* Do essential clean-up */
|
||||||
#ifdef HAVE_GETPID
|
#ifdef HAVE_KILL
|
||||||
kill(getpid(), sig); /* Pretend the signal killed us */
|
kill(getpid(), sig); /* Pretend the signal killed us */
|
||||||
#else
|
#else
|
||||||
exit(1);
|
exit(1);
|
||||||
|
|
Loading…
Reference in New Issue