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
4cb525a1
Unverified
Kaydet (Commit)
4cb525a1
authored
Nis 26, 2019
tarafından
Victor Stinner
Kaydeden (comit)
GitHub
Nis 26, 2019
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
bpo-36356: pymain_exit_error() only call pymain_free() for exit (GH-12968)
Add _Py_INIT_HAS_EXITCODE() macro.
üst
00db7c73
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
3 deletions
+10
-3
coreconfig.h
Include/cpython/coreconfig.h
+3
-1
main.c
Modules/main.c
+6
-1
pylifecycle.c
Python/pylifecycle.c
+1
-1
No files found.
Include/cpython/coreconfig.h
Dosyayı görüntüle @
4cb525a1
...
...
@@ -33,8 +33,10 @@ typedef struct {
#define _Py_INIT_NO_MEMORY() _Py_INIT_USER_ERR("memory allocation failed")
#define _Py_INIT_EXIT(EXITCODE) \
(_PyInitError){.prefix = NULL, .msg = NULL, .user_err = 0, .exitcode = (EXITCODE)}
#define _Py_INIT_HAS_EXITCODE(err) \
(err.exitcode != -1)
#define _Py_INIT_FAILED(err) \
(err.msg != NULL ||
err.exitcode != -1
)
(err.msg != NULL ||
_Py_INIT_HAS_EXITCODE(err)
)
/* --- _PyWstrList ------------------------------------------------ */
...
...
Modules/main.c
Dosyayı görüntüle @
4cb525a1
...
...
@@ -570,7 +570,12 @@ exit_sigint(void)
static
void
_Py_NO_RETURN
pymain_exit_error
(
_PyInitError
err
)
{
pymain_free
();
if
(
_Py_INIT_HAS_EXITCODE
(
err
))
{
/* If it's an error rather than a regular exit, leave Python runtime
alive: _Py_ExitInitError() uses the current exception and use
sys.stdout in this case. */
pymain_free
();
}
_Py_ExitInitError
(
err
);
}
...
...
Python/pylifecycle.c
Dosyayı görüntüle @
4cb525a1
...
...
@@ -2172,7 +2172,7 @@ Py_FatalError(const char *msg)
void
_Py_NO_RETURN
_Py_ExitInitError
(
_PyInitError
err
)
{
if
(
err
.
exitcode
>=
0
)
{
if
(
_Py_INIT_HAS_EXITCODE
(
err
)
)
{
exit
(
err
.
exitcode
);
}
else
{
...
...
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