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
8fea252a
Kaydet (Commit)
8fea252a
authored
Eki 27, 2013
tarafından
Victor Stinner
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Issue #18520: fix reference leak in _PySys_Init()
üst
22da9677
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
7 deletions
+18
-7
sysmodule.c
Python/sysmodule.c
+18
-7
No files found.
Python/sysmodule.c
Dosyayı görüntüle @
8fea252a
...
...
@@ -1573,6 +1573,17 @@ _PySys_Init(void)
if
(
m
==
NULL
)
return
NULL
;
sysdict
=
PyModule_GetDict
(
m
);
#define SET_SYS_FROM_STRING_BORROW(key, value) \
do { \
int res; \
PyObject *v = (value); \
if (v == NULL) \
return NULL; \
res = PyDict_SetItemString(sysdict, key, v); \
if (res < 0) { \
return NULL; \
} \
} while (0)
#define SET_SYS_FROM_STRING(key, value) \
do { \
int res; \
...
...
@@ -1580,8 +1591,8 @@ _PySys_Init(void)
if (v == NULL) \
return NULL; \
res = PyDict_SetItemString(sysdict, key, v); \
Py_DECREF(v); \
if (res < 0) { \
Py_DECREF(v); \
return NULL; \
} \
} while (0)
...
...
@@ -1606,10 +1617,10 @@ _PySys_Init(void)
/* stdin/stdout/stderr are now set by pythonrun.c */
SET_SYS_FROM_STRING
(
"__displayhook__"
,
PyDict_GetItemString
(
sysdict
,
"displayhook"
));
SET_SYS_FROM_STRING
(
"__excepthook__"
,
PyDict_GetItemString
(
sysdict
,
"excepthook"
));
SET_SYS_FROM_STRING
_BORROW
(
"__displayhook__"
,
PyDict_GetItemString
(
sysdict
,
"displayhook"
));
SET_SYS_FROM_STRING
_BORROW
(
"__excepthook__"
,
PyDict_GetItemString
(
sysdict
,
"excepthook"
));
SET_SYS_FROM_STRING
(
"version"
,
PyUnicode_FromString
(
Py_GetVersion
()));
SET_SYS_FROM_STRING
(
"hexversion"
,
...
...
@@ -1679,9 +1690,9 @@ _PySys_Init(void)
else
{
Py_INCREF
(
warnoptions
);
}
SET_SYS_FROM_STRING
(
"warnoptions"
,
warnoptions
);
SET_SYS_FROM_STRING
_BORROW
(
"warnoptions"
,
warnoptions
);
SET_SYS_FROM_STRING
(
"_xoptions"
,
get_xoptions
());
SET_SYS_FROM_STRING
_BORROW
(
"_xoptions"
,
get_xoptions
());
/* version_info */
if
(
VersionInfoType
.
tp_name
==
NULL
)
{
...
...
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