Skip to content

Commit b01c574

Browse files
authored
bpo-29585: Define PYTHONFRAMEWORK in PC/pyconfig.h (#2477)
* bpo-29585: Fix PC/pyconfig.h whitespaces Run "make patchcheck". * bpo-29585: Define PYTHONFRAMEWORK in PC/pyconfig.h * site: Fix path separator in _get_path() on Windows
1 parent a8f8d5b commit b01c574

File tree

2 files changed

+53
-50
lines changed

2 files changed

+53
-50
lines changed

Lib/site.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,7 @@ def _get_path(userbase):
266266
version = sys.version_info
267267

268268
if os.name == 'nt':
269-
return f'{userbase}/Python{version[0]}{version[1]}/site-packages'
269+
return f'{userbase}\\Python{version[0]}{version[1]}\\site-packages'
270270

271271
if sys.platform == 'darwin' and sys._framework:
272272
return f'{userbase}/lib/python/site-packages'

PC/pyconfig.h

Lines changed: 52 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ WIN32 is still required for the locale module.
3131

3232
/* Deprecated USE_DL_EXPORT macro - please use Py_BUILD_CORE */
3333
#ifdef USE_DL_EXPORT
34-
# define Py_BUILD_CORE
34+
# define Py_BUILD_CORE
3535
#endif /* USE_DL_EXPORT */
3636

3737
/* Visual Studio 2005 introduces deprecation warnings for
@@ -62,13 +62,13 @@ WIN32 is still required for the locale module.
6262
#define HAVE_STRFTIME
6363
#define DONT_HAVE_SIG_ALARM
6464
#define DONT_HAVE_SIG_PAUSE
65-
#define LONG_BIT 32
65+
#define LONG_BIT 32
6666
#define WORD_BIT 32
6767

6868
#define MS_WIN32 /* only support win32 and greater. */
6969
#define MS_WINDOWS
7070
#ifndef PYTHONPATH
71-
# define PYTHONPATH L".\\DLLs;.\\lib"
71+
# define PYTHONPATH L".\\DLLs;.\\lib"
7272
#endif
7373
#define NT_THREADS
7474
#define WITH_THREAD
@@ -90,9 +90,9 @@ WIN32 is still required for the locale module.
9090
* literally in the string.
9191
*/
9292
#define _Py_PASTE_VERSION(SUFFIX) \
93-
("[MSC v." _Py_STRINGIZE(_MSC_VER) " " SUFFIX "]")
93+
("[MSC v." _Py_STRINGIZE(_MSC_VER) " " SUFFIX "]")
9494
/* e.g., this produces, after compile-time string catenation,
95-
* ("[MSC v.1200 32 bit (Intel)]")
95+
* ("[MSC v.1200 32 bit (Intel)]")
9696
*
9797
* _Py_STRINGIZE(_MSC_VER) expands to
9898
* _Py_STRINGIZE1((_MSC_VER)) expands to
@@ -111,7 +111,7 @@ WIN32 is still required for the locale module.
111111
*and* on Win64. For the same reasons, in Python, MS_WIN32 is
112112
defined on Win32 *and* Win64. Win32 only code must therefore be
113113
guarded as follows:
114-
#if defined(MS_WIN32) && !defined(MS_WIN64)
114+
#if defined(MS_WIN32) && !defined(MS_WIN64)
115115
Some modules are disabled on Itanium processors, therefore we
116116
have MS_WINI64 set for those targets, otherwise MS_WINX64
117117
*/
@@ -261,80 +261,80 @@ typedef int pid_t;
261261
/* End of compilers - finish up */
262262

263263
#ifndef NO_STDIO_H
264-
# include <stdio.h>
264+
# include <stdio.h>
265265
#endif
266266

267267
/* 64 bit ints are usually spelt __int64 unless compiler has overridden */
268268
#ifndef PY_LONG_LONG
269-
# define PY_LONG_LONG __int64
270-
# define PY_LLONG_MAX _I64_MAX
271-
# define PY_LLONG_MIN _I64_MIN
272-
# define PY_ULLONG_MAX _UI64_MAX
269+
# define PY_LONG_LONG __int64
270+
# define PY_LLONG_MAX _I64_MAX
271+
# define PY_LLONG_MIN _I64_MIN
272+
# define PY_ULLONG_MAX _UI64_MAX
273273
#endif
274274

275275
/* For Windows the Python core is in a DLL by default. Test
276276
Py_NO_ENABLE_SHARED to find out. Also support MS_NO_COREDLL for b/w compat */
277277
#if !defined(MS_NO_COREDLL) && !defined(Py_NO_ENABLE_SHARED)
278-
# define Py_ENABLE_SHARED 1 /* standard symbol for shared library */
279-
# define MS_COREDLL /* deprecated old symbol */
278+
# define Py_ENABLE_SHARED 1 /* standard symbol for shared library */
279+
# define MS_COREDLL /* deprecated old symbol */
280280
#endif /* !MS_NO_COREDLL && ... */
281281

282282
/* All windows compilers that use this header support __declspec */
283283
#define HAVE_DECLSPEC_DLL
284284

285285
/* For an MSVC DLL, we can nominate the .lib files used by extensions */
286286
#ifdef MS_COREDLL
287-
# ifndef Py_BUILD_CORE /* not building the core - must be an ext */
288-
# if defined(_MSC_VER)
289-
/* So MSVC users need not specify the .lib file in
290-
their Makefile (other compilers are generally
291-
taken care of by distutils.) */
292-
# if defined(_DEBUG)
293-
# pragma comment(lib,"python37_d.lib")
294-
# elif defined(Py_LIMITED_API)
295-
# pragma comment(lib,"python3.lib")
296-
# else
297-
# pragma comment(lib,"python37.lib")
298-
# endif /* _DEBUG */
299-
# endif /* _MSC_VER */
300-
# endif /* Py_BUILD_CORE */
287+
# ifndef Py_BUILD_CORE /* not building the core - must be an ext */
288+
# if defined(_MSC_VER)
289+
/* So MSVC users need not specify the .lib file in
290+
their Makefile (other compilers are generally
291+
taken care of by distutils.) */
292+
# if defined(_DEBUG)
293+
# pragma comment(lib,"python37_d.lib")
294+
# elif defined(Py_LIMITED_API)
295+
# pragma comment(lib,"python3.lib")
296+
# else
297+
# pragma comment(lib,"python37.lib")
298+
# endif /* _DEBUG */
299+
# endif /* _MSC_VER */
300+
# endif /* Py_BUILD_CORE */
301301
#endif /* MS_COREDLL */
302302

303303
#if defined(MS_WIN64)
304304
/* maintain "win32" sys.platform for backward compatibility of Python code,
305305
the Win64 API should be close enough to the Win32 API to make this
306306
preferable */
307-
# define PLATFORM "win32"
308-
# define SIZEOF_VOID_P 8
309-
# define SIZEOF_TIME_T 8
310-
# define SIZEOF_OFF_T 4
311-
# define SIZEOF_FPOS_T 8
312-
# define SIZEOF_HKEY 8
313-
# define SIZEOF_SIZE_T 8
307+
# define PLATFORM "win32"
308+
# define SIZEOF_VOID_P 8
309+
# define SIZEOF_TIME_T 8
310+
# define SIZEOF_OFF_T 4
311+
# define SIZEOF_FPOS_T 8
312+
# define SIZEOF_HKEY 8
313+
# define SIZEOF_SIZE_T 8
314314
/* configure.ac defines HAVE_LARGEFILE_SUPPORT iff HAVE_LONG_LONG,
315315
sizeof(off_t) > sizeof(long), and sizeof(PY_LONG_LONG) >= sizeof(off_t).
316316
On Win64 the second condition is not true, but if fpos_t replaces off_t
317317
then this is true. The uses of HAVE_LARGEFILE_SUPPORT imply that Win64
318318
should define this. */
319-
# define HAVE_LARGEFILE_SUPPORT
319+
# define HAVE_LARGEFILE_SUPPORT
320320
#elif defined(MS_WIN32)
321-
# define PLATFORM "win32"
322-
# define HAVE_LARGEFILE_SUPPORT
323-
# define SIZEOF_VOID_P 4
324-
# define SIZEOF_OFF_T 4
325-
# define SIZEOF_FPOS_T 8
326-
# define SIZEOF_HKEY 4
327-
# define SIZEOF_SIZE_T 4
328-
/* MS VS2005 changes time_t to a 64-bit type on all platforms */
329-
# if defined(_MSC_VER) && _MSC_VER >= 1400
330-
# define SIZEOF_TIME_T 8
331-
# else
332-
# define SIZEOF_TIME_T 4
333-
# endif
321+
# define PLATFORM "win32"
322+
# define HAVE_LARGEFILE_SUPPORT
323+
# define SIZEOF_VOID_P 4
324+
# define SIZEOF_OFF_T 4
325+
# define SIZEOF_FPOS_T 8
326+
# define SIZEOF_HKEY 4
327+
# define SIZEOF_SIZE_T 4
328+
/* MS VS2005 changes time_t to a 64-bit type on all platforms */
329+
# if defined(_MSC_VER) && _MSC_VER >= 1400
330+
# define SIZEOF_TIME_T 8
331+
# else
332+
# define SIZEOF_TIME_T 4
333+
# endif
334334
#endif
335335

336336
#ifdef _DEBUG
337-
# define Py_DEBUG
337+
# define Py_DEBUG
338338
#endif
339339

340340

@@ -690,4 +690,7 @@ Py_NO_ENABLE_SHARED to find out. Also support MS_NO_COREDLL for b/w compat */
690690
/* Define to 1 if you have the `erfc' function. */
691691
#define HAVE_ERFC 1
692692

693+
/* framework name */
694+
#define PYTHONFRAMEWORK ""
695+
693696
#endif /* !Py_CONFIG_H */

0 commit comments

Comments
 (0)