Mercurial > cpython-lru_cache-weakref
annotate Include/sysmodule.h @ 73323:dad02a080bbc
Improve byte-compilation in packaging to be independent of -O or -B.
The code I fixed to comply with PEP 3147 still had one bug: When run
under python -O, some paths for pyc files would be pyo, because I called
imp.cache_from_source without explicit debug_override argument in some
places, and under -O that would return .pyo (this is well explained in
the imp docs). Now all code (util.byte_compile, build_py, install_lib)
can create .pyo files according to options given by users,
without interference from the calling Python’s own optimize mode.
On a related topic, I also removed the code that prevented byte
compilation under python -B. The rationale is that packaging gives
control over the creation of pyc files to the user with its own explicit
option, and the behavior should not be changed if the calling Python
happens to run with -B for whatever reason. I will argue that this is a
bug fix and ask to be allowed to backport this change to distutils.
Finally, I moved one nugget of information about the --compile and
--optimize options from the source into the doc. It clears up a
misunderstanding that I (and maybe other people) had.
| author | Éric Araujo <merwok@netwok.org> |
|---|---|
| date | Thu, 03 Nov 2011 05:08:28 +0100 |
| parents | 3c9232a684ae |
| children | 349419bb6283 |
| rev | line source |
|---|---|
| 145 | 1 |
| 6 | 2 /* System module interface */ |
| 3 | |
|
13445
091ca6b9348f
ANSI-fication and Py_PROTO extermination.
Fred Drake <fdrake@acm.org>
parents:
13256
diff
changeset
|
4 #ifndef Py_SYSMODULE_H |
|
091ca6b9348f
ANSI-fication and Py_PROTO extermination.
Fred Drake <fdrake@acm.org>
parents:
13256
diff
changeset
|
5 #define Py_SYSMODULE_H |
|
091ca6b9348f
ANSI-fication and Py_PROTO extermination.
Fred Drake <fdrake@acm.org>
parents:
13256
diff
changeset
|
6 #ifdef __cplusplus |
|
091ca6b9348f
ANSI-fication and Py_PROTO extermination.
Fred Drake <fdrake@acm.org>
parents:
13256
diff
changeset
|
7 extern "C" { |
|
091ca6b9348f
ANSI-fication and Py_PROTO extermination.
Fred Drake <fdrake@acm.org>
parents:
13256
diff
changeset
|
8 #endif |
|
091ca6b9348f
ANSI-fication and Py_PROTO extermination.
Fred Drake <fdrake@acm.org>
parents:
13256
diff
changeset
|
9 |
|
42812
a99ec4befda8
Add const to input string parameters
Neal Norwitz <nnorwitz@gmail.com>
parents:
42071
diff
changeset
|
10 PyAPI_FUNC(PyObject *) PySys_GetObject(const char *); |
|
a99ec4befda8
Add const to input string parameters
Neal Norwitz <nnorwitz@gmail.com>
parents:
42071
diff
changeset
|
11 PyAPI_FUNC(int) PySys_SetObject(const char *, PyObject *); |
|
46318
22a74eaf6b22
Change command line processing API to use wchar_t.
Martin v. Löwis <martin@v.loewis.de>
parents:
42812
diff
changeset
|
12 PyAPI_FUNC(void) PySys_SetArgv(int, wchar_t **); |
|
61791
9db8c414921f
Merged revisions 81400 via svnmerge from
Antoine Pitrou <solipsis@pitrou.net>
parents:
46430
diff
changeset
|
13 PyAPI_FUNC(void) PySys_SetArgvEx(int, wchar_t **, int); |
|
46318
22a74eaf6b22
Change command line processing API to use wchar_t.
Martin v. Löwis <martin@v.loewis.de>
parents:
42812
diff
changeset
|
14 PyAPI_FUNC(void) PySys_SetPath(const wchar_t *); |
|
709
7236e02c4563
Added definitions of sys_trace and sys_profile
Guido van Rossum <guido@python.org>
parents:
145
diff
changeset
|
15 |
|
24752
c1eb668525e1
Excise DL_EXPORT from Include.
Mark Hammond <mhammond@skippinet.com.au>
parents:
20626
diff
changeset
|
16 PyAPI_FUNC(void) PySys_WriteStdout(const char *format, ...) |
|
64064
5d9bdf5aa07b
Issue #9599: Create PySys_FormatStdout() and PySys_FormatStderr()
Victor Stinner <victor.stinner@haypocalc.com>
parents:
61790
diff
changeset
|
17 Py_GCC_ATTRIBUTE((format(printf, 1, 2))); |
|
24752
c1eb668525e1
Excise DL_EXPORT from Include.
Mark Hammond <mhammond@skippinet.com.au>
parents:
20626
diff
changeset
|
18 PyAPI_FUNC(void) PySys_WriteStderr(const char *format, ...) |
|
64064
5d9bdf5aa07b
Issue #9599: Create PySys_FormatStdout() and PySys_FormatStderr()
Victor Stinner <victor.stinner@haypocalc.com>
parents:
61790
diff
changeset
|
19 Py_GCC_ATTRIBUTE((format(printf, 1, 2))); |
|
5d9bdf5aa07b
Issue #9599: Create PySys_FormatStdout() and PySys_FormatStderr()
Victor Stinner <victor.stinner@haypocalc.com>
parents:
61790
diff
changeset
|
20 PyAPI_FUNC(void) PySys_FormatStdout(const char *format, ...); |
|
5d9bdf5aa07b
Issue #9599: Create PySys_FormatStdout() and PySys_FormatStderr()
Victor Stinner <victor.stinner@haypocalc.com>
parents:
61790
diff
changeset
|
21 PyAPI_FUNC(void) PySys_FormatStderr(const char *format, ...); |
| 8313 | 22 |
|
66664
62b61abd02b8
Merge branches/pep-0384.
Martin v. Löwis <martin@v.loewis.de>
parents:
65575
diff
changeset
|
23 #ifndef Py_LIMITED_API |
|
24752
c1eb668525e1
Excise DL_EXPORT from Include.
Mark Hammond <mhammond@skippinet.com.au>
parents:
20626
diff
changeset
|
24 PyAPI_DATA(PyObject *) _PySys_TraceFunc, *_PySys_ProfileFunc; |
|
66664
62b61abd02b8
Merge branches/pep-0384.
Martin v. Löwis <martin@v.loewis.de>
parents:
65575
diff
changeset
|
25 #endif |
|
1329
519c25039c6a
* Added support for X11 modules.
Guido van Rossum <guido@python.org>
parents:
1257
diff
changeset
|
26 |
|
24752
c1eb668525e1
Excise DL_EXPORT from Include.
Mark Hammond <mhammond@skippinet.com.au>
parents:
20626
diff
changeset
|
27 PyAPI_FUNC(void) PySys_ResetWarnOptions(void); |
|
46318
22a74eaf6b22
Change command line processing API to use wchar_t.
Martin v. Löwis <martin@v.loewis.de>
parents:
42812
diff
changeset
|
28 PyAPI_FUNC(void) PySys_AddWarnOption(const wchar_t *); |
|
61751
b7f71f60437b
Issue #8589: Decode PYTHONWARNINGS environment variable with the file system
Victor Stinner <victor.stinner@haypocalc.com>
parents:
57175
diff
changeset
|
29 PyAPI_FUNC(void) PySys_AddWarnOptionUnicode(PyObject *); |
|
46430
47d9bbe10897
Merged revisions 62260-62261,62266,62271,62277-62279,62289-62290,62293-62298,62302-62306,62308,62311,62313-62315,62319-62321 via svnmerge from
Christian Heimes <christian@cheimes.de>
parents:
46318
diff
changeset
|
30 PyAPI_FUNC(int) PySys_HasWarnOptions(void); |
|
15594
1779f8574a83
Add declarations for PySys_ResetWarnOptions() and
Guido van Rossum <guido@python.org>
parents:
14375
diff
changeset
|
31 |
|
65575
0b5bfba7a907
Issue #10089: Add support for arbitrary -X options on the command-line.
Antoine Pitrou <solipsis@pitrou.net>
parents:
64064
diff
changeset
|
32 PyAPI_FUNC(void) PySys_AddXOption(const wchar_t *); |
|
0b5bfba7a907
Issue #10089: Add support for arbitrary -X options on the command-line.
Antoine Pitrou <solipsis@pitrou.net>
parents:
64064
diff
changeset
|
33 PyAPI_FUNC(PyObject *) PySys_GetXOptions(void); |
|
0b5bfba7a907
Issue #10089: Add support for arbitrary -X options on the command-line.
Antoine Pitrou <solipsis@pitrou.net>
parents:
64064
diff
changeset
|
34 |
|
1329
519c25039c6a
* Added support for X11 modules.
Guido van Rossum <guido@python.org>
parents:
1257
diff
changeset
|
35 #ifdef __cplusplus |
|
519c25039c6a
* Added support for X11 modules.
Guido van Rossum <guido@python.org>
parents:
1257
diff
changeset
|
36 } |
|
519c25039c6a
* Added support for X11 modules.
Guido van Rossum <guido@python.org>
parents:
1257
diff
changeset
|
37 #endif |
|
519c25039c6a
* Added support for X11 modules.
Guido van Rossum <guido@python.org>
parents:
1257
diff
changeset
|
38 #endif /* !Py_SYSMODULE_H */ |
