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
4a1468e5
Unverified
Kaydet (Commit)
4a1468e5
authored
Mar 20, 2019
tarafından
Victor Stinner
Kaydeden (comit)
GitHub
Mar 20, 2019
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
bpo-36356: Fix _PyCoreConfig_Read() (GH-12454)
Don't override parameters which are already set by the user.
üst
f29084d6
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
32 additions
and
23 deletions
+32
-23
coreconfig.c
Python/coreconfig.c
+32
-23
No files found.
Python/coreconfig.c
Dosyayı görüntüle @
4a1468e5
...
@@ -961,13 +961,15 @@ config_read_env_vars(_PyCoreConfig *config)
...
@@ -961,13 +961,15 @@ config_read_env_vars(_PyCoreConfig *config)
config
->
malloc_stats
=
1
;
config
->
malloc_stats
=
1
;
}
}
wchar_t
*
path
;
if
(
config
->
module_search_path_env
==
NULL
)
{
int
res
=
_PyCoreConfig_GetEnvDup
(
config
,
&
path
,
wchar_t
*
path
;
L"PYTHONPATH"
,
"PYTHONPATH"
);
int
res
=
_PyCoreConfig_GetEnvDup
(
config
,
&
path
,
if
(
res
<
0
)
{
L"PYTHONPATH"
,
"PYTHONPATH"
);
return
DECODE_LOCALE_ERR
(
"PYTHONPATH"
,
res
);
if
(
res
<
0
)
{
return
DECODE_LOCALE_ERR
(
"PYTHONPATH"
,
res
);
}
config
->
module_search_path_env
=
path
;
}
}
config
->
module_search_path_env
=
path
;
if
(
config
->
use_hash_seed
<
0
)
{
if
(
config
->
use_hash_seed
<
0
)
{
_PyInitError
err
=
config_init_hash_seed
(
config
);
_PyInitError
err
=
config_init_hash_seed
(
config
);
...
@@ -1689,18 +1691,20 @@ config_parse_cmdline(_PyCoreConfig *config, _PyCmdline *cmdline,
...
@@ -1689,18 +1691,20 @@ config_parse_cmdline(_PyCoreConfig *config, _PyCmdline *cmdline,
}
}
if
(
c
==
'c'
)
{
if
(
c
==
'c'
)
{
/* -c is the last option; following arguments
if
(
config
->
run_command
==
NULL
)
{
that look like options are left for the
/* -c is the last option; following arguments
command to interpret. */
that look like options are left for the
size_t
len
=
wcslen
(
_PyOS_optarg
)
+
1
+
1
;
command to interpret. */
wchar_t
*
command
=
PyMem_RawMalloc
(
sizeof
(
wchar_t
)
*
len
);
size_t
len
=
wcslen
(
_PyOS_optarg
)
+
1
+
1
;
if
(
command
==
NULL
)
{
wchar_t
*
command
=
PyMem_RawMalloc
(
sizeof
(
wchar_t
)
*
len
);
return
_Py_INIT_NO_MEMORY
();
if
(
command
==
NULL
)
{
return
_Py_INIT_NO_MEMORY
();
}
memcpy
(
command
,
_PyOS_optarg
,
(
len
-
2
)
*
sizeof
(
wchar_t
));
command
[
len
-
2
]
=
'\n'
;
command
[
len
-
1
]
=
0
;
config
->
run_command
=
command
;
}
}
memcpy
(
command
,
_PyOS_optarg
,
(
len
-
2
)
*
sizeof
(
wchar_t
));
command
[
len
-
2
]
=
'\n'
;
command
[
len
-
1
]
=
0
;
config
->
run_command
=
command
;
break
;
break
;
}
}
...
@@ -1708,9 +1712,11 @@ config_parse_cmdline(_PyCoreConfig *config, _PyCmdline *cmdline,
...
@@ -1708,9 +1712,11 @@ config_parse_cmdline(_PyCoreConfig *config, _PyCmdline *cmdline,
/* -m is the last option; following arguments
/* -m is the last option; following arguments
that look like options are left for the
that look like options are left for the
module to interpret. */
module to interpret. */
config
->
run_module
=
_PyMem_RawWcsdup
(
_PyOS_optarg
);
if
(
config
->
run_module
==
NULL
)
{
if
(
config
->
run_module
==
NULL
)
{
return
_Py_INIT_NO_MEMORY
();
config
->
run_module
=
_PyMem_RawWcsdup
(
_PyOS_optarg
);
if
(
config
->
run_module
==
NULL
)
{
return
_Py_INIT_NO_MEMORY
();
}
}
}
break
;
break
;
}
}
...
@@ -1825,7 +1831,8 @@ config_parse_cmdline(_PyCoreConfig *config, _PyCmdline *cmdline,
...
@@ -1825,7 +1831,8 @@ config_parse_cmdline(_PyCoreConfig *config, _PyCmdline *cmdline,
if
(
config
->
run_command
==
NULL
&&
config
->
run_module
==
NULL
if
(
config
->
run_command
==
NULL
&&
config
->
run_module
==
NULL
&&
_PyOS_optind
<
cmdline
->
argv
.
length
&&
_PyOS_optind
<
cmdline
->
argv
.
length
&&
wcscmp
(
cmdline
->
argv
.
items
[
_PyOS_optind
],
L"-"
)
!=
0
)
&&
wcscmp
(
cmdline
->
argv
.
items
[
_PyOS_optind
],
L"-"
)
!=
0
&&
config
->
run_filename
==
NULL
)
{
{
config
->
run_filename
=
_PyMem_RawWcsdup
(
cmdline
->
argv
.
items
[
_PyOS_optind
]);
config
->
run_filename
=
_PyMem_RawWcsdup
(
cmdline
->
argv
.
items
[
_PyOS_optind
]);
if
(
config
->
run_filename
==
NULL
)
{
if
(
config
->
run_filename
==
NULL
)
{
...
@@ -2032,9 +2039,11 @@ config_from_cmdline(_PyCoreConfig *config, _PyCmdline *cmdline,
...
@@ -2032,9 +2039,11 @@ config_from_cmdline(_PyCoreConfig *config, _PyCmdline *cmdline,
_PyCoreConfig_GetGlobalConfig
(
config
);
_PyCoreConfig_GetGlobalConfig
(
config
);
err
=
config_init_program
(
config
,
cmdline
);
if
(
config
->
program
==
NULL
)
{
if
(
_Py_INIT_FAILED
(
err
))
{
err
=
config_init_program
(
config
,
cmdline
);
return
err
;
if
(
_Py_INIT_FAILED
(
err
))
{
return
err
;
}
}
}
err
=
config_parse_cmdline
(
config
,
cmdline
,
&
need_usage
);
err
=
config_parse_cmdline
(
config
,
cmdline
,
&
need_usage
);
...
...
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