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
0d924433
Kaydet (Commit)
0d924433
authored
Ock 30, 2008
tarafından
Christian Heimes
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Fixed some references leaks in sys.
üst
67ac0667
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
19 additions
and
22 deletions
+19
-22
floatobject.c
Objects/floatobject.c
+0
-1
import.c
Python/import.c
+2
-0
sysmodule.c
Python/sysmodule.c
+17
-21
No files found.
Objects/floatobject.c
Dosyayı görüntüle @
0d924433
...
@@ -143,7 +143,6 @@ PyFloat_GetInfo(void)
...
@@ -143,7 +143,6 @@ PyFloat_GetInfo(void)
return
NULL
;
return
NULL
;
}
}
Py_INCREF
(
floatinfo
);
return
floatinfo
;
return
floatinfo
;
}
}
...
...
Python/import.c
Dosyayı görüntüle @
0d924433
...
@@ -370,6 +370,8 @@ static char* sys_deletes[] = {
...
@@ -370,6 +370,8 @@ static char* sys_deletes[] = {
"exc_type"
,
"exc_value"
,
"exc_traceback"
,
"exc_type"
,
"exc_value"
,
"exc_traceback"
,
"last_type"
,
"last_value"
,
"last_traceback"
,
"last_type"
,
"last_value"
,
"last_traceback"
,
"path_hooks"
,
"path_importer_cache"
,
"meta_path"
,
"path_hooks"
,
"path_importer_cache"
,
"meta_path"
,
/* misc stuff */
"flags"
,
"float_info"
,
NULL
NULL
};
};
...
...
Python/sysmodule.c
Dosyayı görüntüle @
0d924433
...
@@ -1181,7 +1181,6 @@ make_flags(void)
...
@@ -1181,7 +1181,6 @@ make_flags(void)
return
NULL
;
return
NULL
;
}
}
Py_INCREF
(
seq
);
return
seq
;
return
seq
;
}
}
...
@@ -1199,6 +1198,11 @@ _PySys_Init(void)
...
@@ -1199,6 +1198,11 @@ _PySys_Init(void)
if
(
m
==
NULL
)
if
(
m
==
NULL
)
return
NULL
;
return
NULL
;
sysdict
=
PyModule_GetDict
(
m
);
sysdict
=
PyModule_GetDict
(
m
);
#define SET_SYS_FROM_STRING(key, value) \
v = value; \
if (v != NULL) \
PyDict_SetItemString(sysdict, key, v); \
Py_XDECREF(v)
{
{
/* XXX: does this work on Win/Win64? (see posix_fstat) */
/* XXX: does this work on Win/Win64? (see posix_fstat) */
...
@@ -1258,19 +1262,17 @@ _PySys_Init(void)
...
@@ -1258,19 +1262,17 @@ _PySys_Init(void)
Py_XDECREF
(
sysin
);
Py_XDECREF
(
sysin
);
Py_XDECREF
(
sysout
);
Py_XDECREF
(
sysout
);
Py_XDECREF
(
syserr
);
Py_XDECREF
(
syserr
);
PyDict_SetItemString
(
sysdict
,
"version"
,
v
=
PyString_FromString
(
Py_GetVersion
()));
SET_SYS_FROM_STRING
(
"version"
,
Py_XDECREF
(
v
);
PyString_FromString
(
Py_GetVersion
()));
PyDict_SetItemString
(
sysdict
,
"hexversion"
,
SET_SYS_FROM_STRING
(
"hexversion"
,
v
=
PyInt_FromLong
(
PY_VERSION_HEX
));
PyInt_FromLong
(
PY_VERSION_HEX
));
Py_XDECREF
(
v
);
svnversion_init
();
svnversion_init
();
v
=
Py_BuildValue
(
"(ssz)"
,
"CPython"
,
branch
,
svn_revision
);
SET_SYS_FROM_STRING
(
"subversion"
,
PyDict_SetItemString
(
sysdict
,
"subversion"
,
v
);
Py_BuildValue
(
"(ssz)"
,
"CPython"
,
branch
,
Py_XDECREF
(
v
);
svn_revision
));
PyDict_SetItemString
(
sysdict
,
"dont_write_bytecode"
,
SET_SYS_FROM_STRING
(
"dont_write_bytecode"
,
v
=
PyBool_FromLong
(
Py_DontWriteBytecodeFlag
));
PyBool_FromLong
(
Py_DontWriteBytecodeFlag
));
Py_XDECREF
(
v
);
/*
/*
* These release level checks are mutually exclusive and cover
* These release level checks are mutually exclusive and cover
* the field, so don't get too fancy with the pre-processor!
* the field, so don't get too fancy with the pre-processor!
...
@@ -1285,12 +1287,6 @@ _PySys_Init(void)
...
@@ -1285,12 +1287,6 @@ _PySys_Init(void)
s
=
"final"
;
s
=
"final"
;
#endif
#endif
#define SET_SYS_FROM_STRING(key, value) \
v = value; \
if (v != NULL) \
PyDict_SetItemString(sysdict, key, v); \
Py_XDECREF(v)
SET_SYS_FROM_STRING
(
"version_info"
,
SET_SYS_FROM_STRING
(
"version_info"
,
Py_BuildValue
(
"iiisi"
,
PY_MAJOR_VERSION
,
Py_BuildValue
(
"iiisi"
,
PY_MAJOR_VERSION
,
PY_MINOR_VERSION
,
PY_MINOR_VERSION
,
...
@@ -1340,7 +1336,6 @@ _PySys_Init(void)
...
@@ -1340,7 +1336,6 @@ _PySys_Init(void)
SET_SYS_FROM_STRING
(
"winver"
,
SET_SYS_FROM_STRING
(
"winver"
,
PyString_FromString
(
PyWin_DLLVersionString
));
PyString_FromString
(
PyWin_DLLVersionString
));
#endif
#endif
#undef SET_SYS_FROM_STRING
if
(
warnoptions
==
NULL
)
{
if
(
warnoptions
==
NULL
)
{
warnoptions
=
PyList_New
(
0
);
warnoptions
=
PyList_New
(
0
);
}
}
...
@@ -1352,11 +1347,12 @@ _PySys_Init(void)
...
@@ -1352,11 +1347,12 @@ _PySys_Init(void)
}
}
PyStructSequence_InitType
(
&
FlagsType
,
&
flags_desc
);
PyStructSequence_InitType
(
&
FlagsType
,
&
flags_desc
);
PyDict_SetItemString
(
sysdict
,
"flags"
,
make_flags
());
SET_SYS_FROM_STRING
(
"flags"
,
make_flags
());
/* prevent user from creating new instances */
/* prevent user from creating new instances */
FlagsType
.
tp_init
=
NULL
;
FlagsType
.
tp_init
=
NULL
;
FlagsType
.
tp_new
=
NULL
;
FlagsType
.
tp_new
=
NULL
;
#undef SET_SYS_FROM_STRING
if
(
PyErr_Occurred
())
if
(
PyErr_Occurred
())
return
NULL
;
return
NULL
;
return
m
;
return
m
;
...
...
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