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
532d091d
Commit
532d091d
authored
Dec 10, 2010
by
Alexander Belopolsky
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Reverted accidental commit (from r87159)
parent
fc55789c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
29 deletions
+25
-29
Modules/_lsprof.c
Modules/_lsprof.c
+22
-12
Objects/moduleobject.c
Objects/moduleobject.c
+3
-17
No files found.
Modules/_lsprof.c
View file @
532d091d
...
...
@@ -176,21 +176,31 @@ normalizeUserObj(PyObject *obj)
if
(
fn
->
m_self
==
NULL
)
{
/* built-in function: look up the module name */
PyObject
*
mod
=
fn
->
m_module
;
PyObject
*
modname
;
if
(
mod
!=
NULL
)
{
if
(
PyUnicode_Check
(
mod
))
{
modname
=
mod
;
Py_INCREF
(
modname
);
const
char
*
modname
;
if
(
mod
&&
PyUnicode_Check
(
mod
))
{
/* XXX: The following will truncate module names with embedded
* null-characters. It is unlikely that this can happen in
* practice and the concequences are not serious enough to
* introduce extra checks here.
*/
modname
=
_PyUnicode_AsString
(
mod
);
if
(
modname
==
NULL
)
{
modname
=
"<encoding error>"
;
PyErr_Clear
();
}
else
if
(
PyModule_Check
(
mod
))
{
modname
=
PyModule_GetNameObject
(
mod
);
if
(
modname
==
NULL
)
PyErr_Clear
();
}
else
if
(
mod
&&
PyModule_Check
(
mod
))
{
modname
=
PyModule_GetName
(
mod
);
if
(
modname
==
NULL
)
{
PyErr_Clear
();
modname
=
"builtins"
;
}
}
if
(
modname
!=
NULL
&&
PyUnicode_CompareWithASCIIString
(
modname
,
"builtins"
)
!=
0
)
return
PyUnicode_FromFormat
(
"<%U.%s>"
,
else
{
modname
=
"builtins"
;
}
if
(
strcmp
(
modname
,
"builtins"
)
!=
0
)
return
PyUnicode_FromFormat
(
"<%s.%s>"
,
modname
,
fn
->
m_ml
->
ml_name
);
else
...
...
Objects/moduleobject.c
View file @
532d091d
...
...
@@ -168,8 +168,8 @@ PyModule_GetDict(PyObject *m)
return
d
;
}
PyObject
*
PyModule_GetName
Object
(
PyObject
*
m
)
const
char
*
PyModule_GetName
(
PyObject
*
m
)
{
PyObject
*
d
;
PyObject
*
nameobj
;
...
...
@@ -185,21 +185,7 @@ PyModule_GetNameObject(PyObject *m)
PyErr_SetString
(
PyExc_SystemError
,
"nameless module"
);
return
NULL
;
}
Py_INCREF
(
nameobj
);
return
nameobj
;
}
const
char
*
PyModule_GetName
(
PyObject
*
m
)
{
PyObject
*
nameobj
;
char
*
utf8
;
nameobj
=
PyModule_GetNameObject
(
m
);
if
(
nameobj
==
NULL
)
return
NULL
;
utf8
=
_PyUnicode_AsString
(
nameobj
);
Py_DECREF
(
nameobj
);
return
utf8
;
return
_PyUnicode_AsString
(
nameobj
);
}
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