summaryrefslogtreecommitdiff
path: root/Python/_warnings.c
diff options
context:
space:
mode:
authorBrett Cannon <brett@python.org>2015-04-13 14:21:02 -0400
committerBrett Cannon <brett@python.org>2015-04-13 14:21:02 -0400
commitf299abdafa0f2b6eb7abae274861b19b361c96bc (patch)
treeafc3a2bf560e30c7725510eda3b57d71ceddba00 /Python/_warnings.c
parenta63cc212348e276c8ede32773313c60ff7fda651 (diff)
downloadcpython-git-f299abdafa0f2b6eb7abae274861b19b361c96bc.tar.gz
Issue #23731: Implement PEP 488.
The concept of .pyo files no longer exists. Now .pyc files have an optional `opt-` tag which specifies if any extra optimizations beyond the peepholer were applied.
Diffstat (limited to 'Python/_warnings.c')
-rw-r--r--Python/_warnings.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/Python/_warnings.c b/Python/_warnings.c
index a1f4368ebe..eb2942458d 100644
--- a/Python/_warnings.c
+++ b/Python/_warnings.c
@@ -563,13 +563,12 @@ setup_context(Py_ssize_t stack_level, PyObject **filename, int *lineno,
data = PyUnicode_DATA(*filename);
#define ascii_lower(c) ((c <= 127) ? Py_TOLOWER(c) : 0)
- /* if filename.lower().endswith((".pyc", ".pyo")): */
+ /* if filename.lower().endswith(".pyc"): */
if (len >= 4 &&
PyUnicode_READ(kind, data, len-4) == '.' &&
ascii_lower(PyUnicode_READ(kind, data, len-3)) == 'p' &&
ascii_lower(PyUnicode_READ(kind, data, len-2)) == 'y' &&
- (ascii_lower(PyUnicode_READ(kind, data, len-1)) == 'c' ||
- ascii_lower(PyUnicode_READ(kind, data, len-1)) == 'o'))
+ ascii_lower(PyUnicode_READ(kind, data, len-1)) == 'c')
{
*filename = PyUnicode_Substring(*filename, 0,
PyUnicode_GET_LENGTH(*filename)-1);