Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
7e52705e
Commit
7e52705e
authored
Jan 20, 2014
by
Serhiy Storchaka
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Issue #20315: Removed support for backward compatibility with early 2.x versions.
parent
6c01e386
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
3 additions
and
93 deletions
+3
-93
Lib/configparser.py
Lib/configparser.py
+0
-17
Lib/modulefinder.py
Lib/modulefinder.py
+1
-28
Lib/optparse.py
Lib/optparse.py
+2
-8
Modules/_lsprof.c
Modules/_lsprof.c
+0
-12
Modules/_tkinter.c
Modules/_tkinter.c
+0
-14
Modules/gcmodule.c
Modules/gcmodule.c
+0
-14
No files found.
Lib/configparser.py
View file @
7e52705e
...
@@ -144,23 +144,6 @@ MAX_INTERPOLATION_DEPTH = 10
...
@@ -144,23 +144,6 @@ MAX_INTERPOLATION_DEPTH = 10
class
Error
(
Exception
):
class
Error
(
Exception
):
"""Base class for ConfigParser exceptions."""
"""Base class for ConfigParser exceptions."""
def
_get_message
(
self
):
"""Getter for 'message'; needed only to override deprecation in
BaseException.
"""
return
self
.
__message
def
_set_message
(
self
,
value
):
"""Setter for 'message'; needed only to override deprecation in
BaseException.
"""
self
.
__message
=
value
# BaseException.message has been deprecated since Python 2.6. To prevent
# DeprecationWarning from popping up over this pre-existing attribute, use
# a new property that takes lookup precedence.
message
=
property
(
_get_message
,
_set_message
)
def
__init__
(
self
,
msg
=
''
):
def
__init__
(
self
,
msg
=
''
):
self
.
message
=
msg
self
.
message
=
msg
Exception
.
__init__
(
self
,
msg
)
Exception
.
__init__
(
self
,
msg
)
...
...
Lib/modulefinder.py
View file @
7e52705e
...
@@ -332,30 +332,6 @@ class ModuleFinder:
...
@@ -332,30 +332,6 @@ class ModuleFinder:
fullname
=
name
+
"."
+
sub
fullname
=
name
+
"."
+
sub
self
.
_add_badmodule
(
fullname
,
caller
)
self
.
_add_badmodule
(
fullname
,
caller
)
def
scan_opcodes
(
self
,
co
,
unpack
=
struct
.
unpack
):
# Scan the code, and yield 'interesting' opcode combinations
# Version for Python 2.4 and older
code
=
co
.
co_code
names
=
co
.
co_names
consts
=
co
.
co_consts
while
code
:
c
=
code
[
0
]
if
c
in
STORE_OPS
:
oparg
,
=
unpack
(
'<H'
,
code
[
1
:
3
])
yield
"store"
,
(
names
[
oparg
],)
code
=
code
[
3
:]
continue
if
c
==
LOAD_CONST
and
code
[
3
]
==
IMPORT_NAME
:
oparg_1
,
oparg_2
=
unpack
(
'<xHxH'
,
code
[:
6
])
yield
"import"
,
(
consts
[
oparg_1
],
names
[
oparg_2
])
code
=
code
[
6
:]
continue
if
c
>=
HAVE_ARGUMENT
:
code
=
code
[
3
:]
else
:
code
=
code
[
1
:]
def
scan_opcodes_25
(
self
,
co
,
def
scan_opcodes_25
(
self
,
co
,
unpack
=
struct
.
unpack
):
unpack
=
struct
.
unpack
):
# Scan the code, and yield 'interesting' opcode combinations
# Scan the code, and yield 'interesting' opcode combinations
...
@@ -387,10 +363,7 @@ class ModuleFinder:
...
@@ -387,10 +363,7 @@ class ModuleFinder:
def
scan_code
(
self
,
co
,
m
):
def
scan_code
(
self
,
co
,
m
):
code
=
co
.
co_code
code
=
co
.
co_code
if
sys
.
version_info
>=
(
2
,
5
):
scanner
=
self
.
scan_opcodes_25
scanner
=
self
.
scan_opcodes_25
else
:
scanner
=
self
.
scan_opcodes
for
what
,
args
in
scanner
(
co
):
for
what
,
args
in
scanner
(
co
):
if
what
==
"store"
:
if
what
==
"store"
:
name
,
=
args
name
,
=
args
...
...
Lib/optparse.py
View file @
7e52705e
...
@@ -645,14 +645,8 @@ class Option:
...
@@ -645,14 +645,8 @@ class Option:
self
.
type
=
"string"
self
.
type
=
"string"
else
:
else
:
# Allow type objects or builtin type conversion functions
# Allow type objects or builtin type conversion functions
# (int, str, etc.) as an alternative to their names. (The
# (int, str, etc.) as an alternative to their names.
# complicated check of builtins is only necessary for
if
isinstance
(
self
.
type
,
type
):
# Python 2.1 and earlier, and is short-circuited by the
# first check on modern Pythons.)
import
builtins
if
(
isinstance
(
self
.
type
,
type
)
or
(
hasattr
(
self
.
type
,
"__name__"
)
and
getattr
(
builtins
,
self
.
type
.
__name__
,
None
)
is
self
.
type
)
):
self
.
type
=
self
.
type
.
__name__
self
.
type
=
self
.
type
.
__name__
if
self
.
type
==
"str"
:
if
self
.
type
==
"str"
:
...
...
Modules/_lsprof.c
View file @
7e52705e
...
@@ -455,7 +455,6 @@ profiler_callback(PyObject *self, PyFrameObject *frame, int what,
...
@@ -455,7 +455,6 @@ profiler_callback(PyObject *self, PyFrameObject *frame, int what,
PyTrace_RETURN event will be generated, so we don't need to
PyTrace_RETURN event will be generated, so we don't need to
handle it. */
handle it. */
#ifdef PyTrace_C_CALL
/* not defined in Python <= 2.3 */
/* the Python function 'frame' is issuing a call to the built-in
/* the Python function 'frame' is issuing a call to the built-in
function 'arg' */
function 'arg' */
case
PyTrace_C_CALL
:
case
PyTrace_C_CALL
:
...
@@ -477,7 +476,6 @@ profiler_callback(PyObject *self, PyFrameObject *frame, int what,
...
@@ -477,7 +476,6 @@ profiler_callback(PyObject *self, PyFrameObject *frame, int what,
((
PyCFunctionObject
*
)
arg
)
->
m_ml
);
((
PyCFunctionObject
*
)
arg
)
->
m_ml
);
}
}
break
;
break
;
#endif
default:
default:
break
;
break
;
...
@@ -667,13 +665,7 @@ setBuiltins(ProfilerObject *pObj, int nvalue)
...
@@ -667,13 +665,7 @@ setBuiltins(ProfilerObject *pObj, int nvalue)
if
(
nvalue
==
0
)
if
(
nvalue
==
0
)
pObj
->
flags
&=
~
POF_BUILTINS
;
pObj
->
flags
&=
~
POF_BUILTINS
;
else
if
(
nvalue
>
0
)
{
else
if
(
nvalue
>
0
)
{
#ifndef PyTrace_C_CALL
PyErr_SetString
(
PyExc_ValueError
,
"builtins=True requires Python >= 2.4"
);
return
-
1
;
#else
pObj
->
flags
|=
POF_BUILTINS
;
pObj
->
flags
|=
POF_BUILTINS
;
#endif
}
}
return
0
;
return
0
;
}
}
...
@@ -771,11 +763,7 @@ profiler_init(ProfilerObject *pObj, PyObject *args, PyObject *kw)
...
@@ -771,11 +763,7 @@ profiler_init(ProfilerObject *pObj, PyObject *args, PyObject *kw)
PyObject
*
timer
=
NULL
;
PyObject
*
timer
=
NULL
;
double
timeunit
=
0
.
0
;
double
timeunit
=
0
.
0
;
int
subcalls
=
1
;
int
subcalls
=
1
;
#ifdef PyTrace_C_CALL
int
builtins
=
1
;
int
builtins
=
1
;
#else
int
builtins
=
0
;
#endif
static
char
*
kwlist
[]
=
{
"timer"
,
"timeunit"
,
static
char
*
kwlist
[]
=
{
"timer"
,
"timeunit"
,
"subcalls"
,
"builtins"
,
0
};
"subcalls"
,
"builtins"
,
0
};
...
...
Modules/_tkinter.c
View file @
7e52705e
...
@@ -33,20 +33,6 @@ Copyright (C) 1994 Steen Lumholt.
...
@@ -33,20 +33,6 @@ Copyright (C) 1994 Steen Lumholt.
#include <windows.h>
#include <windows.h>
#endif
#endif
/* Allow using this code in Python 2.[12] */
#ifndef PyDoc_STRVAR
#define PyDoc_STRVAR(name,str) static char name[] = str
#endif
#ifndef PyMODINIT_FUNC
#define PyMODINIT_FUNC void
#endif
#ifndef PyBool_Check
#define PyBool_Check(o) 0
#define PyBool_FromLong PyLong_FromLong
#endif
#define CHECK_SIZE(size, elemsize) \
#define CHECK_SIZE(size, elemsize) \
((size_t)(size) <= Py_MAX((size_t)INT_MAX, UINT_MAX / (size_t)(elemsize)))
((size_t)(size) <= Py_MAX((size_t)INT_MAX, UINT_MAX / (size_t)(elemsize)))
...
...
Modules/gcmodule.c
View file @
7e52705e
...
@@ -1534,13 +1534,6 @@ PyObject_GC_Track(void *op)
...
@@ -1534,13 +1534,6 @@ PyObject_GC_Track(void *op)
_PyObject_GC_TRACK
(
op
);
_PyObject_GC_TRACK
(
op
);
}
}
/* for binary compatibility with 2.2 */
void
_PyObject_GC_Track
(
PyObject
*
op
)
{
PyObject_GC_Track
(
op
);
}
void
void
PyObject_GC_UnTrack
(
void
*
op
)
PyObject_GC_UnTrack
(
void
*
op
)
{
{
...
@@ -1551,13 +1544,6 @@ PyObject_GC_UnTrack(void *op)
...
@@ -1551,13 +1544,6 @@ PyObject_GC_UnTrack(void *op)
_PyObject_GC_UNTRACK
(
op
);
_PyObject_GC_UNTRACK
(
op
);
}
}
/* for binary compatibility with 2.2 */
void
_PyObject_GC_UnTrack
(
PyObject
*
op
)
{
PyObject_GC_UnTrack
(
op
);
}
PyObject
*
PyObject
*
_PyObject_GC_Malloc
(
size_t
basicsize
)
_PyObject_GC_Malloc
(
size_t
basicsize
)
{
{
...
...
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