classification
Title: symtable: get_namespace doesn't check whether if there are multiple namespaces or no namespaces at all
Type: Stage: patch review
Components: Library (Lib) Versions: Python 3.10
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: BTaskaya Nosy List: BTaskaya, benjamin.peterson
Priority: normal Keywords: patch

Created on 2020-11-14 10:27 by BTaskaya, last changed 2020-11-14 10:35 by BTaskaya.

Pull Requests
URL Status Linked Edit
PR 23278 open BTaskaya, 2020-11-14 10:35
Messages (1)
msg380969 - (view) Author: Batuhan Taskaya (BTaskaya) * (Python committer) Date: 2020-11-14 10:27
>>> table = symtable.symtable("A = 1", "<string>", "exec")
>>> table.lookup("A")
<symbol 'A'>
>>> table.lookup("A").get_namespace()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python3.10/symtable.py", line 312, in get_namespace
    raise ValueError("name is bound to multiple namespaces")
ValueError: name is bound to multiple namespaces
>>> table.lookup("A").get_namespaces()
()
History
Date User Action Args
2020-11-14 10:35:59BTaskayasetkeywords: + patch
stage: patch review
pull_requests: + pull_request22172
2020-11-14 10:27:36BTaskayacreate