diff --git a/CHANGES.rst b/CHANGES.rst index 459049ec..af7d2358 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -59,6 +59,7 @@ Changes in this release include the following: * Sort pages by dock_pos when added to automatic (agw.aui) notebook. (#882) +* Fix a bug in py.introspect.getTokens. (#889) diff --git a/wx/py/introspect.py b/wx/py/introspect.py index d5548cd9..0c809672 100644 --- a/wx/py/introspect.py +++ b/wx/py/introspect.py @@ -325,7 +325,8 @@ def getTokens(command): tokens.append(args) tokenize.tokenize_loop(f.readline, eater) else: - tokens = list(tokenize.tokenize(f.readline)) + for t in tokenize.tokenize(f.readline): + tokens.append(t) except tokenize.TokenError: # This is due to a premature EOF, which we expect since we are # feeding in fragments of Python code.