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
f5ad33e4
Commit
f5ad33e4
authored
Aug 22, 2001
by
Barry Warsaw
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Merge changes from r22a2-branch back into trunk. Also, change patch
level to 2.2a2+
parent
aaf65418
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
36 additions
and
18 deletions
+36
-18
Include/patchlevel.h
Include/patchlevel.h
+2
-2
Lib/test/test_os.py
Lib/test/test_os.py
+3
-0
Modules/Setup.dist
Modules/Setup.dist
+1
-5
Objects/typeobject.c
Objects/typeobject.c
+30
-7
setup.py
setup.py
+0
-4
No files found.
Include/patchlevel.h
View file @
f5ad33e4
...
...
@@ -23,10 +23,10 @@
#define PY_MINOR_VERSION 2
#define PY_MICRO_VERSION 0
#define PY_RELEASE_LEVEL PY_RELEASE_LEVEL_ALPHA
#define PY_RELEASE_SERIAL
1
#define PY_RELEASE_SERIAL
2
/* Version as a string */
#define PY_VERSION "2.2a
1
+"
#define PY_VERSION "2.2a
2
+"
/* Version as a single 4-byte hex number, e.g. 0x010502B2 == 1.5.2b2.
Use this for numeric comparisons, e.g. #if PY_VERSION_HEX >= ... */
...
...
Lib/test/test_os.py
View file @
f5ad33e4
...
...
@@ -6,6 +6,9 @@ import os
import
unittest
import
warnings
warnings
.
filterwarnings
(
"ignore"
,
"tempnam"
,
RuntimeWarning
,
__name__
)
warnings
.
filterwarnings
(
"ignore"
,
"tmpnam"
,
RuntimeWarning
,
__name__
)
from
test_support
import
TESTFN
,
run_unittest
...
...
Modules/Setup.dist
View file @
f5ad33e4
...
...
@@ -98,6 +98,7 @@ PYTHONPATH=$(COREPYTHONPATH)
posix
posixmodule.c
# posix (UNIX) system calls
_sre
_sre.c
# Fredrik Lundh's new regular expressions
new
newmodule.c
# Tommy Burnette's 'new' module
# The rest of the modules listed in this file are all commented out by
# default. Usually they can be detected and built as dynamically
...
...
@@ -347,11 +348,6 @@ GLHACK=-Dclear=__GLclear
#_curses_panel _curses_panel.c -lpanel -lncurses
# Tommy Burnette's 'new' module (creates new empty objects of certain kinds):
#new newmodule.c
# Generic (SunOS / SVR4) dynamic loading module.
# This is not needed for dynamic loading of Python modules --
# it is a highly experimental and dangerous device for calling
...
...
Objects/typeobject.c
View file @
f5ad33e4
...
...
@@ -2091,29 +2091,52 @@ static struct wrapperbase tab_init[] = {
static
PyObject
*
tp_new_wrapper
(
PyObject
*
self
,
PyObject
*
args
,
PyObject
*
kwds
)
{
PyTypeObject
*
type
,
*
subtype
;
PyTypeObject
*
type
,
*
subtype
,
*
staticbase
;
PyObject
*
arg0
,
*
res
;
if
(
self
==
NULL
||
!
PyType_Check
(
self
))
Py_FatalError
(
"__new__() called with non-type 'self'"
);
type
=
(
PyTypeObject
*
)
self
;
if
(
!
PyTuple_Check
(
args
)
||
PyTuple_GET_SIZE
(
args
)
<
1
)
{
PyErr_SetString
(
PyExc_TypeError
,
"T.__new__(): not enough arguments"
);
PyErr_Format
(
PyExc_TypeError
,
"%s.__new__(): not enough arguments"
,
type
->
tp_name
);
return
NULL
;
}
arg0
=
PyTuple_GET_ITEM
(
args
,
0
);
if
(
!
PyType_Check
(
arg0
))
{
PyErr_SetString
(
PyExc_TypeError
,
"T.__new__(S): S is not a type object"
);
PyErr_Format
(
PyExc_TypeError
,
"%s.__new__(X): X is not a type object (%s)"
,
type
->
tp_name
,
arg0
->
ob_type
->
tp_name
);
return
NULL
;
}
subtype
=
(
PyTypeObject
*
)
arg0
;
if
(
!
PyType_IsSubtype
(
subtype
,
type
))
{
PyErr_SetString
(
PyExc_TypeError
,
"T.__new__(S): S is not a subtype of T"
);
PyErr_Format
(
PyExc_TypeError
,
"%s.__new__(%s): %s is not a subtype of %s"
,
type
->
tp_name
,
subtype
->
tp_name
,
subtype
->
tp_name
,
type
->
tp_name
);
return
NULL
;
}
/* Check that the use doesn't do something silly and unsafe like
object.__new__(dictionary). To do this, we check that the
most derived base that's not a heap type is this type. */
staticbase
=
subtype
;
while
(
staticbase
&&
(
staticbase
->
tp_flags
&
Py_TPFLAGS_HEAPTYPE
))
staticbase
=
staticbase
->
tp_base
;
if
(
staticbase
!=
type
)
{
PyErr_Format
(
PyExc_TypeError
,
"%s.__new__(%s) is not safe, use %s.__new__()"
,
type
->
tp_name
,
subtype
->
tp_name
,
staticbase
==
NULL
?
"?"
:
staticbase
->
tp_name
);
return
NULL
;
}
args
=
PyTuple_GetSlice
(
args
,
1
,
PyTuple_GET_SIZE
(
args
));
if
(
args
==
NULL
)
return
NULL
;
...
...
setup.py
View file @
f5ad33e4
...
...
@@ -269,10 +269,6 @@ class PyBuildExt(build_ext):
# (NIST's Secure Hash Algorithm.)
exts
.
append
(
Extension
(
'sha'
,
[
'shamodule.c'
])
)
# Tommy Burnette's 'new' module (creates new empty objects of certain
# kinds):
exts
.
append
(
Extension
(
'new'
,
[
'newmodule.c'
])
)
# Helper module for various ascii-encoders
exts
.
append
(
Extension
(
'binascii'
,
[
'binascii.c'
])
)
...
...
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