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
f3923e9d
Kaydet (Commit)
f3923e9d
authored
Tem 24, 2012
tarafından
Antoine Pitrou
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Issue #15413: os.times() had disappeared under Windows.
üst
4c668965
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
25 deletions
+27
-25
NEWS
Misc/NEWS
+2
-0
posixmodule.c
Modules/posixmodule.c
+25
-25
No files found.
Misc/NEWS
Dosyayı görüntüle @
f3923e9d
...
...
@@ -52,6 +52,8 @@ Core and Builtins
Library
-------
-
Issue
#
15413
:
os
.
times
()
had
disappeared
under
Windows
.
-
Issue
#
15402
:
An
issue
in
the
struct
module
that
caused
sys
.
getsizeof
to
return
incorrect
results
for
struct
.
Struct
instances
has
been
fixed
.
Initial
patch
by
Serhiy
Storchaka
.
...
...
Modules/posixmodule.c
Dosyayı görüntüle @
f3923e9d
...
...
@@ -7453,8 +7453,11 @@ static PyStructSequence_Desc times_result_desc = {
static
PyTypeObject
TimesResultType
;
#ifdef MS_WINDOWS
#define HAVE_TIMES
/* mandatory, for the method table */
#endif
#if
defined(HAVE_TIMES) || defined(MS_WINDOWS)
#if
def HAVE_TIMES
static
PyObject
*
build_times_result
(
double
user
,
double
system
,
...
...
@@ -7492,10 +7495,6 @@ Return an object containing floating point numbers indicating process\n\
times. The object behaves like a named tuple with these fields:
\n
\
(utime, stime, cutime, cstime, elapsed_time)"
);
#endif
#ifdef HAVE_TIMES
#if defined(PYCC_VACPP) && defined(PYOS_OS2)
static
long
system_uptime
(
void
)
...
...
@@ -7520,26 +7519,6 @@ posix_times(PyObject *self, PyObject *noargs)
(
double
)
0
/* t.tms_cstime / HZ */
,
(
double
)
system_uptime
()
/
1000
);
}
#else
/* not OS2 */
#define NEED_TICKS_PER_SECOND
static
long
ticks_per_second
=
-
1
;
static
PyObject
*
posix_times
(
PyObject
*
self
,
PyObject
*
noargs
)
{
struct
tms
t
;
clock_t
c
;
errno
=
0
;
c
=
times
(
&
t
);
if
(
c
==
(
clock_t
)
-
1
)
return
posix_error
();
return
build_times_result
(
(
double
)
t
.
tms_utime
/
ticks_per_second
,
(
double
)
t
.
tms_stime
/
ticks_per_second
,
(
double
)
t
.
tms_cutime
/
ticks_per_second
,
(
double
)
t
.
tms_cstime
/
ticks_per_second
,
(
double
)
c
/
ticks_per_second
);
}
#endif
/* not OS2 */
#elif defined(MS_WINDOWS)
static
PyObject
*
posix_times
(
PyObject
*
self
,
PyObject
*
noargs
)
...
...
@@ -7562,8 +7541,29 @@ posix_times(PyObject *self, PyObject *noargs)
(
double
)
0
,
(
double
)
0
);
}
#else
/* Neither Windows nor OS/2 */
#define NEED_TICKS_PER_SECOND
static
long
ticks_per_second
=
-
1
;
static
PyObject
*
posix_times
(
PyObject
*
self
,
PyObject
*
noargs
)
{
struct
tms
t
;
clock_t
c
;
errno
=
0
;
c
=
times
(
&
t
);
if
(
c
==
(
clock_t
)
-
1
)
return
posix_error
();
return
build_times_result
(
(
double
)
t
.
tms_utime
/
ticks_per_second
,
(
double
)
t
.
tms_stime
/
ticks_per_second
,
(
double
)
t
.
tms_cutime
/
ticks_per_second
,
(
double
)
t
.
tms_cstime
/
ticks_per_second
,
(
double
)
c
/
ticks_per_second
);
}
#endif
#endif
/* HAVE_TIMES */
#ifdef HAVE_GETSID
PyDoc_STRVAR
(
posix_getsid__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