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
4631da12
Unverified
Kaydet (Commit)
4631da12
authored
May 02, 2019
tarafından
Victor Stinner
Kaydeden (comit)
GitHub
May 02, 2019
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
bpo-36763: Remove _PyCoreConfig._init_main (GH-13066)
üst
70005ac0
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
10 additions
and
19 deletions
+10
-19
coreconfig.h
Include/cpython/coreconfig.h
+1
-5
test_embed.py
Lib/test/test_embed.py
+8
-5
_freeze_importlib.c
Programs/_freeze_importlib.c
+0
-1
_testembed.c
Programs/_testembed.c
+0
-5
coreconfig.c
Python/coreconfig.c
+0
-2
pylifecycle.c
Python/pylifecycle.c
+1
-1
No files found.
Include/cpython/coreconfig.h
Dosyayı görüntüle @
4631da12
...
...
@@ -391,9 +391,6 @@ typedef struct {
If set to -1 (default), inherit Py_FrozenFlag value. */
int
_frozen
;
/* If non-zero, use "main" Python initialization */
int
_init_main
;
}
_PyCoreConfig
;
#ifdef MS_WINDOWS
...
...
@@ -428,8 +425,7 @@ typedef struct {
.buffered_stdio = -1, \
._install_importlib = 1, \
.check_hash_pycs_mode = NULL, \
._frozen = -1, \
._init_main = 1}
._frozen = -1}
/* Note: _PyCoreConfig_INIT sets other fields to 0/NULL */
#ifdef __cplusplus
...
...
Lib/test/test_embed.py
Dosyayı görüntüle @
4631da12
...
...
@@ -348,7 +348,6 @@ class InitConfigTests(EmbeddingTestsMixin, unittest.TestCase):
'_install_importlib'
:
1
,
'check_hash_pycs_mode'
:
'default'
,
'_frozen'
:
0
,
'_init_main'
:
1
,
}
if
MS_WINDOWS
:
DEFAULT_PRE_CONFIG
.
update
({
...
...
@@ -443,7 +442,10 @@ class InitConfigTests(EmbeddingTestsMixin, unittest.TestCase):
raise
Exception
(
f
"failed to get the default config: "
f
"stdout={proc.stdout!r} stderr={proc.stderr!r}"
)
stdout
=
proc
.
stdout
.
decode
(
'utf-8'
)
config
=
json
.
loads
(
stdout
)
try
:
config
=
json
.
loads
(
stdout
)
except
json
.
JSONDecodeError
:
self
.
fail
(
f
"fail to decode stdout: {stdout!r}"
)
for
key
,
value
in
expected
.
items
():
if
value
is
self
.
GET_DEFAULT_CONFIG
:
...
...
@@ -496,7 +498,10 @@ class InitConfigTests(EmbeddingTestsMixin, unittest.TestCase):
out
,
err
=
self
.
run_embedded_interpreter
(
testname
,
env
=
env
)
# Ignore err
config
=
json
.
loads
(
out
)
try
:
config
=
json
.
loads
(
out
)
except
json
.
JSONDecodeError
:
self
.
fail
(
f
"fail to decode stdout: {out!r}"
)
expected_preconfig
=
dict
(
self
.
DEFAULT_PRE_CONFIG
,
**
expected_preconfig
)
expected_config
=
self
.
get_expected_config
(
expected_config
,
env
)
...
...
@@ -533,7 +538,6 @@ class InitConfigTests(EmbeddingTestsMixin, unittest.TestCase):
'filesystem_encoding'
:
'utf-8'
,
'filesystem_errors'
:
self
.
UTF8_MODE_ERRORS
,
'user_site_directory'
:
0
,
'_frozen'
:
1
,
}
self
.
check_config
(
"init_global_config"
,
config
,
preconfig
)
...
...
@@ -578,7 +582,6 @@ class InitConfigTests(EmbeddingTestsMixin, unittest.TestCase):
'faulthandler'
:
1
,
'check_hash_pycs_mode'
:
'always'
,
'_frozen'
:
1
,
}
self
.
check_config
(
"init_from_config"
,
config
,
preconfig
)
...
...
Programs/_freeze_importlib.c
Dosyayı görüntüle @
4631da12
...
...
@@ -84,7 +84,6 @@ main(int argc, char *argv[])
/* Don't install importlib, since it could execute outdated bytecode. */
config
.
_install_importlib
=
0
;
config
.
_frozen
=
1
;
config
.
_init_main
=
0
;
_PyInitError
err
=
_Py_InitializeFromConfig
(
&
config
);
/* No need to call _PyCoreConfig_Clear() since we didn't allocate any
...
...
Programs/_testembed.c
Dosyayı görüntüle @
4631da12
...
...
@@ -354,8 +354,6 @@ static int test_init_global_config(void)
putenv
(
"PYTHONUNBUFFERED="
);
Py_UnbufferedStdioFlag
=
1
;
Py_FrozenFlag
=
1
;
/* FIXME: test Py_LegacyWindowsFSEncodingFlag */
/* FIXME: test Py_LegacyWindowsStdioFlag */
...
...
@@ -497,9 +495,6 @@ static int test_init_from_config(void)
config
.
check_hash_pycs_mode
=
L"always"
;
Py_FrozenFlag
=
0
;
config
.
_frozen
=
1
;
err
=
_Py_InitializeFromConfig
(
&
config
);
if
(
_Py_INIT_FAILED
(
err
))
{
_Py_ExitInitError
(
err
);
...
...
Python/coreconfig.c
Dosyayı görüntüle @
4631da12
...
...
@@ -667,7 +667,6 @@ _PyCoreConfig_Copy(_PyCoreConfig *config, const _PyCoreConfig *config2)
COPY_WSTR_ATTR
(
run_filename
);
COPY_WSTR_ATTR
(
check_hash_pycs_mode
);
COPY_ATTR
(
_frozen
);
COPY_ATTR
(
_init_main
);
#undef COPY_ATTR
#undef COPY_WSTR_ATTR
...
...
@@ -766,7 +765,6 @@ _PyCoreConfig_AsDict(const _PyCoreConfig *config)
SET_ITEM_INT
(
_install_importlib
);
SET_ITEM_WSTR
(
check_hash_pycs_mode
);
SET_ITEM_INT
(
_frozen
);
SET_ITEM_INT
(
_init_main
);
return
dict
;
...
...
Python/pylifecycle.c
Dosyayı görüntüle @
4631da12
...
...
@@ -988,7 +988,7 @@ init_python(const _PyCoreConfig *config, const _PyArgv *args)
}
config
=
&
interp
->
core_config
;
if
(
config
->
_init_mai
n
)
{
if
(
!
config
->
_froze
n
)
{
err
=
_Py_InitializeMainInterpreter
(
runtime
,
interp
);
if
(
_Py_INIT_FAILED
(
err
))
{
return
err
;
...
...
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