Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
cpython
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
cpython
Commits
6d0d3655
Kaydet (Commit)
6d0d3655
authored
Ock 07, 2003
tarafından
Guido van Rossum
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Fix from Michael Stone for SF bug #660476 and #513033 (bogus thread
state swaps in readline).
üst
05ac449d
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
13 deletions
+12
-13
ACKS
Misc/ACKS
+1
-0
NEWS
Misc/NEWS
+4
-0
readline.c
Modules/readline.c
+7
-13
No files found.
Misc/ACKS
Dosyayı görüntüle @
6d0d3655
...
@@ -511,6 +511,7 @@ Frank Stajano
...
@@ -511,6 +511,7 @@ Frank Stajano
Richard Stoakley
Richard Stoakley
Casper Stoel
Casper Stoel
Peter Stoehr
Peter Stoehr
Michael Stone
Ken Stox
Ken Stox
Daniel Stutzbach
Daniel Stutzbach
Paul Swartz
Paul Swartz
...
...
Misc/NEWS
Dosyayı görüntüle @
6d0d3655
...
@@ -21,6 +21,10 @@ Core and builtins
...
@@ -21,6 +21,10 @@ Core and builtins
Extension
modules
Extension
modules
-----------------
-----------------
-
Fixed
broken
threadstate
swap
in
readline
that
could
cause
fatal
errors
when
a
readline
hook
was
being
invoked
while
a
background
thread
was
active
.
(
SF
bugs
#
660476
and
#
513033.
)
-
fcntl
now
exposes
the
strops
.
h
I_
*
constants
.
-
fcntl
now
exposes
the
strops
.
h
I_
*
constants
.
-
datetime
changes
:
-
datetime
changes
:
...
...
Modules/readline.c
Dosyayı görüntüle @
6d0d3655
...
@@ -481,16 +481,14 @@ static struct PyMethodDef readline_methods[] =
...
@@ -481,16 +481,14 @@ static struct PyMethodDef readline_methods[] =
/* C function to call the Python hooks. */
/* C function to call the Python hooks. */
static
int
static
int
on_hook
(
PyObject
*
func
,
PyThreadState
*
tstate
)
on_hook
(
PyObject
*
func
,
PyThreadState
*
*
tstate
)
{
{
int
result
=
0
;
int
result
=
0
;
if
(
func
!=
NULL
)
{
if
(
func
!=
NULL
)
{
PyObject
*
r
;
PyObject
*
r
;
PyThreadState
*
save_tstate
;
/* Note that readline is called with the interpreter
/* Note that readline is called with the interpreter
lock released! */
lock released! */
save_tstate
=
PyThreadState_Swap
(
NULL
);
PyEval_RestoreThread
(
*
tstate
);
PyEval_RestoreThread
(
tstate
);
r
=
PyObject_CallFunction
(
func
,
NULL
);
r
=
PyObject_CallFunction
(
func
,
NULL
);
if
(
r
==
NULL
)
if
(
r
==
NULL
)
goto
error
;
goto
error
;
...
@@ -504,8 +502,7 @@ on_hook(PyObject *func, PyThreadState *tstate)
...
@@ -504,8 +502,7 @@ on_hook(PyObject *func, PyThreadState *tstate)
PyErr_Clear
();
PyErr_Clear
();
Py_XDECREF
(
r
);
Py_XDECREF
(
r
);
done:
done:
PyEval_SaveThread
();
*
tstate
=
PyEval_SaveThread
();
PyThreadState_Swap
(
save_tstate
);
}
}
return
result
;
return
result
;
}
}
...
@@ -513,14 +510,14 @@ on_hook(PyObject *func, PyThreadState *tstate)
...
@@ -513,14 +510,14 @@ on_hook(PyObject *func, PyThreadState *tstate)
static
int
static
int
on_startup_hook
(
void
)
on_startup_hook
(
void
)
{
{
return
on_hook
(
startup_hook
,
startup_hook_tstate
);
return
on_hook
(
startup_hook
,
&
startup_hook_tstate
);
}
}
#ifdef HAVE_RL_PRE_INPUT_HOOK
#ifdef HAVE_RL_PRE_INPUT_HOOK
static
int
static
int
on_pre_input_hook
(
void
)
on_pre_input_hook
(
void
)
{
{
return
on_hook
(
pre_input_hook
,
pre_input_hook_tstate
);
return
on_hook
(
pre_input_hook
,
&
pre_input_hook_tstate
);
}
}
#endif
#endif
...
@@ -533,10 +530,8 @@ on_completion(char *text, int state)
...
@@ -533,10 +530,8 @@ on_completion(char *text, int state)
char
*
result
=
NULL
;
char
*
result
=
NULL
;
if
(
completer
!=
NULL
)
{
if
(
completer
!=
NULL
)
{
PyObject
*
r
;
PyObject
*
r
;
PyThreadState
*
save_tstate
;
/* Note that readline is called with the interpreter
/* Note that readline is called with the interpreter
lock released! */
lock released! */
save_tstate
=
PyThreadState_Swap
(
NULL
);
PyEval_RestoreThread
(
completer_tstate
);
PyEval_RestoreThread
(
completer_tstate
);
/* Don't use the default filename completion if we
/* Don't use the default filename completion if we
* have a custom completion function... */
* have a custom completion function... */
...
@@ -559,14 +554,13 @@ on_completion(char *text, int state)
...
@@ -559,14 +554,13 @@ on_completion(char *text, int state)
PyErr_Clear
();
PyErr_Clear
();
Py_XDECREF
(
r
);
Py_XDECREF
(
r
);
done:
done:
PyEval_SaveThread
();
completer_tstate
=
PyEval_SaveThread
();
PyThreadState_Swap
(
save_tstate
);
}
}
return
result
;
return
result
;
}
}
/*
a
more flexible constructor that saves the "begidx" and "endidx"
/*
A
more flexible constructor that saves the "begidx" and "endidx"
* before calling the normal completer */
* before calling the normal completer */
char
**
char
**
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment