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
a70805e1
Commit
a70805e1
authored
Jan 12, 2014
by
Ethan Furman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Issue19995: fixed typo; switched from test.support.check_warnings to assertWarns
parent
61dab6e3
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
17 deletions
+7
-17
Lib/test/test_unicode.py
Lib/test/test_unicode.py
+5
-15
Objects/unicodeobject.c
Objects/unicodeobject.c
+2
-2
No files found.
Lib/test/test_unicode.py
View file @
a70805e1
...
...
@@ -1139,13 +1139,6 @@ class UnicodeTest(string_tests.CommonTest,
self
.
value
=
float
(
value
)
def
__int__
(
self
):
return
int
(
self
.
value
)
def
check_depr
(
modifier
,
value
):
with
support
.
check_warnings
(
(
""
,
DeprecationWarning
),
quiet
=
False
,
):
warnings
.
simplefilter
(
'always'
)
modifier
%
value
pi
=
PsuedoFloat
(
3.1415
)
letter_m
=
PsuedoInt
(
109
)
self
.
assertEqual
(
'%x'
%
42
,
'2a'
)
...
...
@@ -1156,14 +1149,11 @@ class UnicodeTest(string_tests.CommonTest,
self
.
assertEqual
(
'%X'
%
letter_m
,
'6D'
)
self
.
assertEqual
(
'%o'
%
letter_m
,
'155'
)
self
.
assertEqual
(
'%c'
%
letter_m
,
'm'
)
for
mod
,
value
in
(
(
'%x'
,
pi
),
(
'%x'
,
3.14
),
(
'%X'
,
2.11
),
(
'%o'
,
1.79
),
(
'%c'
,
pi
),
):
check_depr
(
mod
,
value
)
self
.
assertWarns
(
DeprecationWarning
,
'%x'
.
__mod__
,
pi
),
self
.
assertWarns
(
DeprecationWarning
,
'%x'
.
__mod__
,
3.14
),
self
.
assertWarns
(
DeprecationWarning
,
'%X'
.
__mod__
,
2.11
),
self
.
assertWarns
(
DeprecationWarning
,
'%o'
.
__mod__
,
1.79
),
self
.
assertWarns
(
DeprecationWarning
,
'%c'
.
__mod__
,
pi
),
def
test_formatting_with_enum
(
self
):
# issue18780
...
...
Objects/unicodeobject.c
View file @
a70805e1
...
...
@@ -14005,7 +14005,7 @@ mainformatlong(PyObject *v,
goto
wrongtype
;
/* make sure number is a type of integer */
/* if not, issue depr
a
cation warning for now */
/* if not, issue depr
e
cation warning for now */
if
(
!
PyLong_Check
(
v
))
{
if
(
type
==
'o'
||
type
==
'x'
||
type
==
'X'
)
{
iobj
=
PyNumber_Index
(
v
);
...
...
@@ -14103,7 +14103,7 @@ formatchar(PyObject *v)
PyObject
*
iobj
;
long
x
;
/* make sure number is a type of integer */
/* if not, issue depr
a
cation warning for now */
/* if not, issue depr
e
cation warning for now */
if
(
!
PyLong_Check
(
v
))
{
iobj
=
PyNumber_Index
(
v
);
if
(
iobj
==
NULL
)
{
...
...
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