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
657d06b1
Commit
657d06b1
authored
Oct 26, 2013
by
Benjamin Peterson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
just return toplevel symbol table rather than all blocks (closes #19393)
parent
70f213ab
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
5 additions
and
5 deletions
+5
-5
Lib/symtable.py
Lib/symtable.py
+1
-4
Misc/NEWS
Misc/NEWS
+3
-0
Modules/symtablemodule.c
Modules/symtablemodule.c
+1
-1
No files found.
Lib/symtable.py
View file @
657d06b1
...
@@ -10,10 +10,7 @@ import weakref
...
@@ -10,10 +10,7 @@ import weakref
__all__
=
[
"symtable"
,
"SymbolTable"
,
"Class"
,
"Function"
,
"Symbol"
]
__all__
=
[
"symtable"
,
"SymbolTable"
,
"Class"
,
"Function"
,
"Symbol"
]
def
symtable
(
code
,
filename
,
compile_type
):
def
symtable
(
code
,
filename
,
compile_type
):
raw
=
_symtable
.
symtable
(
code
,
filename
,
compile_type
)
top
=
_symtable
.
symtable
(
code
,
filename
,
compile_type
)
for
top
in
raw
.
itervalues
():
if
top
.
name
==
'top'
:
break
return
_newSymbolTable
(
top
,
filename
)
return
_newSymbolTable
(
top
,
filename
)
class
SymbolTableFactory
:
class
SymbolTableFactory
:
...
...
Misc/NEWS
View file @
657d06b1
...
@@ -40,6 +40,9 @@ Core and Builtins
...
@@ -40,6 +40,9 @@ Core and Builtins
Library
Library
-------
-------
-
Issue
#
19393
:
Fix
symtable
.
symtable
function
to
not
be
confused
when
there
are
functions
or
classes
named
"top"
.
-
Issue
#
19327
:
Fixed
the
working
of
regular
expressions
with
too
big
charset
.
-
Issue
#
19327
:
Fixed
the
working
of
regular
expressions
with
too
big
charset
.
-
Issue
#
19350
:
Increasing
the
test
coverage
of
macurl2path
.
Patch
by
Colin
-
Issue
#
19350
:
Increasing
the
test
coverage
of
macurl2path
.
Patch
by
Colin
...
...
Modules/symtablemodule.c
View file @
657d06b1
...
@@ -33,7 +33,7 @@ symtable_symtable(PyObject *self, PyObject *args)
...
@@ -33,7 +33,7 @@ symtable_symtable(PyObject *self, PyObject *args)
st
=
Py_SymtableString
(
str
,
filename
,
start
);
st
=
Py_SymtableString
(
str
,
filename
,
start
);
if
(
st
==
NULL
)
if
(
st
==
NULL
)
return
NULL
;
return
NULL
;
t
=
st
->
st_symbols
;
t
=
(
PyObject
*
)
st
->
st_top
;
Py_INCREF
(
t
);
Py_INCREF
(
t
);
PyMem_Free
((
void
*
)
st
->
st_future
);
PyMem_Free
((
void
*
)
st
->
st_future
);
PySymtable_Free
(
st
);
PySymtable_Free
(
st
);
...
...
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