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
e5e065b6
Kaydet (Commit)
e5e065b6
authored
Tem 06, 2003
tarafından
Tim Peters
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
New function sys.getcheckinterval(), to complement setcheckinterval().
üst
d6640d4b
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
24 additions
and
2 deletions
+24
-2
libsys.tex
Doc/lib/libsys.tex
+5
-0
test_sys.py
Lib/test/test_sys.py
+4
-2
NEWS
Misc/NEWS
+3
-0
sysmodule.c
Python/sysmodule.c
+12
-0
No files found.
Doc/lib/libsys.tex
Dosyayı görüntüle @
e5e065b6
...
@@ -197,6 +197,11 @@ It is always available.
...
@@ -197,6 +197,11 @@ It is always available.
or when
\code
{
os.
_
exit()
}
is called.
}
or when
\code
{
os.
_
exit()
}
is called.
}
\end{datadesc}
\end{datadesc}
\begin{funcdesc}
{
getcheckinterval
}{}
Return the interpreter's ``check interval'';
see
\function
{
setcheckinterval()
}
.
\end{funcdesc}
\begin{funcdesc}
{
getdefaultencoding
}{}
\begin{funcdesc}
{
getdefaultencoding
}{}
Return the name of the current default string encoding used by the
Return the name of the current default string encoding used by the
Unicode implementation.
Unicode implementation.
...
...
Lib/test/test_sys.py
Dosyayı görüntüle @
e5e065b6
...
@@ -172,8 +172,10 @@ class SysModuleTest(unittest.TestCase):
...
@@ -172,8 +172,10 @@ class SysModuleTest(unittest.TestCase):
def
test_setcheckinterval
(
self
):
def
test_setcheckinterval
(
self
):
self
.
assertRaises
(
TypeError
,
sys
.
setcheckinterval
)
self
.
assertRaises
(
TypeError
,
sys
.
setcheckinterval
)
sys
.
setcheckinterval
(
120
)
orig
=
sys
.
getcheckinterval
()
sys
.
setcheckinterval
(
100
)
for
n
in
0
,
100
,
120
,
orig
:
# orig last to restore starting state
sys
.
setcheckinterval
(
n
)
self
.
assertEquals
(
sys
.
getcheckinterval
(),
n
)
def
test_recursionlimit
(
self
):
def
test_recursionlimit
(
self
):
self
.
assertRaises
(
TypeError
,
sys
.
getrecursionlimit
,
42
)
self
.
assertRaises
(
TypeError
,
sys
.
getrecursionlimit
,
42
)
...
...
Misc/NEWS
Dosyayı görüntüle @
e5e065b6
...
@@ -10,6 +10,9 @@ What's New in Python 2.3 release candidate?
...
@@ -10,6 +10,9 @@ What's New in Python 2.3 release candidate?
Core and builtins
Core and builtins
-----------------
-----------------
- The new function sys.getcheckinterval() returns the last value set
by sys.setcheckinterval().
- The Windows implementation of PyThread_start_new_thread() never
- The Windows implementation of PyThread_start_new_thread() never
checked error returns from Windows functions correctly. As a result,
checked error returns from Windows functions correctly. As a result,
it could claim to start a new thread even when the Microsoft
it could claim to start a new thread even when the Microsoft
...
...
Python/sysmodule.c
Dosyayı görüntüle @
e5e065b6
...
@@ -431,6 +431,16 @@ Tell the Python interpreter to check for asynchronous events every\n\
...
@@ -431,6 +431,16 @@ Tell the Python interpreter to check for asynchronous events every\n\
n instructions. This also affects how often thread switches occur."
n instructions. This also affects how often thread switches occur."
);
);
static
PyObject
*
sys_getcheckinterval
(
PyObject
*
self
,
PyObject
*
args
)
{
return
PyInt_FromLong
(
_Py_CheckInterval
);
}
PyDoc_STRVAR
(
getcheckinterval_doc
,
"getcheckinterval() -> current check interval; see setcheckinterval()."
);
static
PyObject
*
static
PyObject
*
sys_setrecursionlimit
(
PyObject
*
self
,
PyObject
*
args
)
sys_setrecursionlimit
(
PyObject
*
self
,
PyObject
*
args
)
{
{
...
@@ -723,6 +733,8 @@ static PyMethodDef sys_methods[] = {
...
@@ -723,6 +733,8 @@ static PyMethodDef sys_methods[] = {
#endif
#endif
{
"setcheckinterval"
,
sys_setcheckinterval
,
METH_VARARGS
,
{
"setcheckinterval"
,
sys_setcheckinterval
,
METH_VARARGS
,
setcheckinterval_doc
},
setcheckinterval_doc
},
{
"getcheckinterval"
,
sys_getcheckinterval
,
METH_NOARGS
,
getcheckinterval_doc
},
#ifdef HAVE_DLOPEN
#ifdef HAVE_DLOPEN
{
"setdlopenflags"
,
sys_setdlopenflags
,
METH_VARARGS
,
{
"setdlopenflags"
,
sys_setdlopenflags
,
METH_VARARGS
,
setdlopenflags_doc
},
setdlopenflags_doc
},
...
...
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