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
233ccf28
Commit
233ccf28
authored
Jun 05, 2007
by
Walter Dörwald
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Change int_oct() and int_hex() to return unicode objects.
parent
5b0443cf
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
9 deletions
+5
-9
Objects/intobject.c
Objects/intobject.c
+5
-9
No files found.
Objects/intobject.c
View file @
233ccf28
...
...
@@ -920,27 +920,23 @@ int_float(PyIntObject *v)
static
PyObject
*
int_oct
(
PyIntObject
*
v
)
{
char
buf
[
100
];
long
x
=
v
->
ob_ival
;
if
(
x
<
0
)
PyOS_snprintf
(
buf
,
sizeof
(
buf
),
"-0%lo"
,
-
x
);
return
PyUnicode_FromFormat
(
"-0%lo"
,
-
x
);
else
if
(
x
==
0
)
strcpy
(
buf
,
"0"
);
return
PyUnicode_FromString
(
"0"
);
else
PyOS_snprintf
(
buf
,
sizeof
(
buf
),
"0%lo"
,
x
);
return
PyString_FromString
(
buf
);
return
PyUnicode_FromFormat
(
"0%lo"
,
x
);
}
static
PyObject
*
int_hex
(
PyIntObject
*
v
)
{
char
buf
[
100
];
long
x
=
v
->
ob_ival
;
if
(
x
<
0
)
PyOS_snprintf
(
buf
,
sizeof
(
buf
),
"-0x%lx"
,
-
x
);
return
PyUnicode_FromFormat
(
"-0x%lx"
,
-
x
);
else
PyOS_snprintf
(
buf
,
sizeof
(
buf
),
"0x%lx"
,
x
);
return
PyString_FromString
(
buf
);
return
PyUnicode_FromFormat
(
"0x%lx"
,
x
);
}
static
PyObject
*
...
...
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