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
891f2631
Kaydet (Commit)
891f2631
authored
Ock 29, 2009
tarafından
Mark Hammond
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Fix issue5076: bdist_wininst fails on py3k
üst
6d0e9757
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
40 additions
and
7 deletions
+40
-7
wininst-9.0-amd64.exe
Lib/distutils/command/wininst-9.0-amd64.exe
+0
-0
wininst-9.0.exe
Lib/distutils/command/wininst-9.0.exe
+0
-0
install.c
PC/bdist_wininst/install.c
+40
-7
No files found.
Lib/distutils/command/wininst-9.0-amd64.exe
Dosyayı görüntüle @
891f2631
This diff was suppressed by a .gitattributes entry.
Lib/distutils/command/wininst-9.0.exe
Dosyayı görüntüle @
891f2631
This diff was suppressed by a .gitattributes entry.
PC/bdist_wininst/install.c
Dosyayı görüntüle @
891f2631
...
...
@@ -114,6 +114,7 @@
FILE
*
logfile
;
char
modulename
[
MAX_PATH
];
wchar_t
wmodulename
[
MAX_PATH
];
HWND
hwndMain
;
HWND
hDialog
;
...
...
@@ -299,6 +300,27 @@ static int do_compile_files(int (__cdecl * PyRun_SimpleString)(char *),
typedef
void
PyObject
;
// Convert a "char *" string to "whcar_t *", or NULL on error.
// Result string must be free'd
wchar_t
*
widen_string
(
char
*
src
)
{
wchar_t
*
result
;
DWORD
dest_cch
;
int
src_len
=
strlen
(
src
)
+
1
;
// include NULL term in all ops
/* use MultiByteToWideChar() to see how much we need. */
/* NOTE: this will include the null-term in the length */
dest_cch
=
MultiByteToWideChar
(
CP_ACP
,
0
,
src
,
src_len
,
NULL
,
0
);
// alloc the buffer
result
=
(
wchar_t
*
)
malloc
(
dest_cch
*
sizeof
(
wchar_t
));
if
(
result
==
NULL
)
return
NULL
;
/* do the conversion */
if
(
0
==
MultiByteToWideChar
(
CP_ACP
,
0
,
src
,
src_len
,
result
,
dest_cch
))
{
free
(
result
);
return
NULL
;
}
return
result
;
}
/*
* Returns number of files which failed to compile,
...
...
@@ -307,7 +329,7 @@ typedef void PyObject;
static
int
compile_filelist
(
HINSTANCE
hPython
,
BOOL
optimize_flag
)
{
DECLPROC
(
hPython
,
void
,
Py_Initialize
,
(
void
));
DECLPROC
(
hPython
,
void
,
Py_SetProgramName
,
(
char
*
));
DECLPROC
(
hPython
,
void
,
Py_SetProgramName
,
(
wchar_t
*
));
DECLPROC
(
hPython
,
void
,
Py_Finalize
,
(
void
));
DECLPROC
(
hPython
,
int
,
PyRun_SimpleString
,
(
char
*
));
DECLPROC
(
hPython
,
PyObject
*
,
PySys_GetObject
,
(
char
*
));
...
...
@@ -326,7 +348,7 @@ static int compile_filelist(HINSTANCE hPython, BOOL optimize_flag)
return
-
1
;
*
Py_OptimizeFlag
=
optimize_flag
?
1
:
0
;
Py_SetProgramName
(
modulename
);
Py_SetProgramName
(
w
modulename
);
Py_Initialize
();
errors
+=
do_compile_files
(
PyRun_SimpleString
,
optimize_flag
);
...
...
@@ -696,9 +718,10 @@ static int prepare_script_environment(HINSTANCE hPython)
static
int
do_run_installscript
(
HINSTANCE
hPython
,
char
*
pathname
,
int
argc
,
char
**
argv
)
{
int
fh
,
result
;
int
fh
,
result
,
i
;
static
wchar_t
*
wargv
[
256
];
DECLPROC
(
hPython
,
void
,
Py_Initialize
,
(
void
));
DECLPROC
(
hPython
,
int
,
PySys_SetArgv
,
(
int
,
char
**
));
DECLPROC
(
hPython
,
int
,
PySys_SetArgv
,
(
int
,
wchar_t
**
));
DECLPROC
(
hPython
,
int
,
PyRun_SimpleString
,
(
char
*
));
DECLPROC
(
hPython
,
void
,
Py_Finalize
,
(
void
));
DECLPROC
(
hPython
,
PyObject
*
,
Py_BuildValue
,
(
char
*
,
...));
...
...
@@ -732,7 +755,16 @@ do_run_installscript(HINSTANCE hPython, char *pathname, int argc, char **argv)
Py_Initialize
();
prepare_script_environment
(
hPython
);
PySys_SetArgv
(
argc
,
argv
);
// widen the argv array for py3k.
memset
(
wargv
,
0
,
sizeof
(
wargv
));
for
(
i
=
0
;
i
<
argc
;
i
++
)
wargv
[
i
]
=
argv
[
i
]
?
widen_string
(
argv
[
i
])
:
NULL
;
PySys_SetArgv
(
argc
,
wargv
);
// free the strings we just widened.
for
(
i
=
0
;
i
<
argc
;
i
++
)
if
(
wargv
[
i
])
free
(
wargv
[
i
]);
result
=
3
;
{
struct
_stat
statbuf
;
...
...
@@ -807,7 +839,7 @@ static int do_run_simple_script(HINSTANCE hPython, char *script)
{
int
rc
;
DECLPROC
(
hPython
,
void
,
Py_Initialize
,
(
void
));
DECLPROC
(
hPython
,
void
,
Py_SetProgramName
,
(
char
*
));
DECLPROC
(
hPython
,
void
,
Py_SetProgramName
,
(
wchar_t
*
));
DECLPROC
(
hPython
,
void
,
Py_Finalize
,
(
void
));
DECLPROC
(
hPython
,
int
,
PyRun_SimpleString
,
(
char
*
));
DECLPROC
(
hPython
,
void
,
PyErr_Print
,
(
void
));
...
...
@@ -816,7 +848,7 @@ static int do_run_simple_script(HINSTANCE hPython, char *script)
!
PyRun_SimpleString
||
!
PyErr_Print
)
return
-
1
;
Py_SetProgramName
(
modulename
);
Py_SetProgramName
(
w
modulename
);
Py_Initialize
();
prepare_script_environment
(
hPython
);
rc
=
PyRun_SimpleString
(
script
);
...
...
@@ -2618,6 +2650,7 @@ int WINAPI WinMain(HINSTANCE hInst, HINSTANCE hPrevInst,
char
*
basename
;
GetModuleFileName
(
NULL
,
modulename
,
sizeof
(
modulename
));
GetModuleFileNameW
(
NULL
,
wmodulename
,
sizeof
(
wmodulename
)
/
sizeof
(
wmodulename
[
0
]));
/* Map the executable file to memory */
arc_data
=
MapExistingFile
(
modulename
,
&
arc_size
);
...
...
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