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
f3fd733f
Commit
f3fd733f
authored
Mar 02, 2011
by
Victor Stinner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove useless argument of _PyUnicode_AsDefaultEncodedString()
parent
6f58b6b5
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
9 additions
and
13 deletions
+9
-13
Include/unicodeobject.h
Include/unicodeobject.h
+1
-2
Modules/_ctypes/_ctypes.c
Modules/_ctypes/_ctypes.c
+1
-1
Modules/_dbmmodule.c
Modules/_dbmmodule.c
+1
-1
Objects/typeobject.c
Objects/typeobject.c
+1
-1
Objects/unicodeobject.c
Objects/unicodeobject.c
+2
-5
Python/bltinmodule.c
Python/bltinmodule.c
+1
-1
Python/compile.c
Python/compile.c
+1
-1
Python/getargs.c
Python/getargs.c
+1
-1
No files found.
Include/unicodeobject.h
View file @
f3fd733f
...
...
@@ -668,8 +668,7 @@ PyAPI_FUNC(int) PyUnicode_ClearFreeList(void);
#ifndef Py_LIMITED_API
PyAPI_FUNC
(
PyObject
*
)
_PyUnicode_AsDefaultEncodedString
(
PyObject
*
unicode
,
const
char
*
errors
);
PyObject
*
unicode
);
#endif
/* Returns a pointer to the default encoding (UTF-8) of the
...
...
Modules/_ctypes/_ctypes.c
View file @
f3fd733f
...
...
@@ -1826,7 +1826,7 @@ PyCSimpleType_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
return
NULL
;
}
if
(
PyUnicode_Check
(
proto
))
{
PyObject
*
v
=
_PyUnicode_AsDefaultEncodedString
(
proto
,
NULL
);
PyObject
*
v
=
_PyUnicode_AsDefaultEncodedString
(
proto
);
if
(
!
v
)
goto
error
;
proto_str
=
PyBytes_AS_STRING
(
v
);
...
...
Modules/_dbmmodule.c
View file @
f3fd733f
...
...
@@ -219,7 +219,7 @@ dbm_contains(PyObject *self, PyObject *arg)
return
-
1
;
}
if
(
PyUnicode_Check
(
arg
))
{
arg
=
_PyUnicode_AsDefaultEncodedString
(
arg
,
NULL
);
arg
=
_PyUnicode_AsDefaultEncodedString
(
arg
);
if
(
arg
==
NULL
)
return
-
1
;
}
...
...
Objects/typeobject.c
View file @
f3fd733f
...
...
@@ -4975,7 +4975,7 @@ slot_tp_str(PyObject *self)
res
=
slot_tp_repr
(
self
);
if
(
!
res
)
return
NULL
;
ress
=
_PyUnicode_AsDefaultEncodedString
(
res
,
NULL
);
ress
=
_PyUnicode_AsDefaultEncodedString
(
res
);
Py_DECREF
(
res
);
return
ress
;
}
...
...
Objects/unicodeobject.c
View file @
f3fd733f
...
...
@@ -1806,14 +1806,11 @@ PyUnicode_AsEncodedUnicode(PyObject *unicode,
}
PyObject
*
_PyUnicode_AsDefaultEncodedString
(
PyObject
*
unicode
,
const
char
*
errors
)
_PyUnicode_AsDefaultEncodedString
(
PyObject
*
unicode
)
{
PyObject
*
v
=
((
PyUnicodeObject
*
)
unicode
)
->
defenc
;
if
(
v
)
return
v
;
if
(
errors
!=
NULL
)
Py_FatalError
(
"non-NULL encoding in _PyUnicode_AsDefaultEncodedString"
);
v
=
PyUnicode_EncodeUTF8
(
PyUnicode_AS_UNICODE
(
unicode
),
PyUnicode_GET_SIZE
(
unicode
),
NULL
);
...
...
@@ -1959,7 +1956,7 @@ _PyUnicode_AsStringAndSize(PyObject *unicode, Py_ssize_t *psize)
PyErr_BadArgument
();
return
NULL
;
}
bytes
=
_PyUnicode_AsDefaultEncodedString
(
unicode
,
NULL
);
bytes
=
_PyUnicode_AsDefaultEncodedString
(
unicode
);
if
(
bytes
==
NULL
)
return
NULL
;
if
(
psize
!=
NULL
)
...
...
Python/bltinmodule.c
View file @
f3fd733f
...
...
@@ -511,7 +511,7 @@ source_as_string(PyObject *cmd, char *funcname, char *what, PyCompilerFlags *cf)
if
(
PyUnicode_Check
(
cmd
))
{
cf
->
cf_flags
|=
PyCF_IGNORE_COOKIE
;
cmd
=
_PyUnicode_AsDefaultEncodedString
(
cmd
,
NULL
);
cmd
=
_PyUnicode_AsDefaultEncodedString
(
cmd
);
if
(
cmd
==
NULL
)
return
NULL
;
}
...
...
Python/compile.c
View file @
f3fd733f
...
...
@@ -3026,7 +3026,7 @@ expr_constant(struct compiler *c, expr_ty e)
case
Name_kind
:
/* optimize away names that can't be reassigned */
id
=
PyBytes_AS_STRING
(
_PyUnicode_AsDefaultEncodedString
(
e
->
v
.
Name
.
id
,
NULL
));
_PyUnicode_AsDefaultEncodedString
(
e
->
v
.
Name
.
id
));
if
(
strcmp
(
id
,
"True"
)
==
0
)
return
1
;
if
(
strcmp
(
id
,
"False"
)
==
0
)
return
0
;
if
(
strcmp
(
id
,
"None"
)
==
0
)
return
0
;
...
...
Python/getargs.c
View file @
f3fd733f
...
...
@@ -551,7 +551,7 @@ convertitem(PyObject *arg, const char **p_format, va_list *p_va, int flags,
#define UNICODE_DEFAULT_ENCODING(arg) \
_PyUnicode_AsDefaultEncodedString(arg
, NULL
)
_PyUnicode_AsDefaultEncodedString(arg)
/* Format an error message generated by convertsimple(). */
...
...
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