-
Notifications
You must be signed in to change notification settings - Fork 658
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Python console: do not require output that looks like a traceback to …
…be valid (#2410)
- Loading branch information
1 parent
96a0cdf
commit 50dd4d8
Showing
3 changed files
with
115 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,108 @@ | ||
---input--- | ||
>>> from multiprocessing import Pool | ||
>>> p = Pool(5) | ||
>>> def f(x): | ||
... return x*x | ||
... | ||
>>> with p: | ||
... p.map(f, [1,2,3]) | ||
Process PoolWorker-1: | ||
Process PoolWorker-2: | ||
Process PoolWorker-3: | ||
Traceback (most recent call last): | ||
Traceback (most recent call last): | ||
Traceback (most recent call last): | ||
AttributeError: Can't get attribute 'f' on <module '__main__' (<class '_frozen_importlib.BuiltinImporter'>)> | ||
AttributeError: Can't get attribute 'f' on <module '__main__' (<class '_frozen_importlib.BuiltinImporter'>)> | ||
AttributeError: Can't get attribute 'f' on <module '__main__' (<class '_frozen_importlib.BuiltinImporter'>)> | ||
|
||
---tokens--- | ||
'>>> ' Generic.Prompt | ||
'from' Keyword.Namespace | ||
' ' Text | ||
'multiprocessing' Name.Namespace | ||
' ' Text | ||
'import' Keyword.Namespace | ||
' ' Text | ||
'Pool' Name | ||
'\n' Text.Whitespace | ||
|
||
'>>> ' Generic.Prompt | ||
'p' Name | ||
' ' Text | ||
'=' Operator | ||
' ' Text | ||
'Pool' Name | ||
'(' Punctuation | ||
'5' Literal.Number.Integer | ||
')' Punctuation | ||
'\n' Text.Whitespace | ||
|
||
'>>> ' Generic.Prompt | ||
'def' Keyword | ||
' ' Text | ||
'f' Name.Function | ||
'(' Punctuation | ||
'x' Name | ||
')' Punctuation | ||
':' Punctuation | ||
'\n' Text.Whitespace | ||
|
||
'... ' Generic.Prompt | ||
' ' Text | ||
'return' Keyword | ||
' ' Text | ||
'x' Name | ||
'*' Operator | ||
'x' Name | ||
'\n' Text.Whitespace | ||
|
||
'...' Generic.Prompt | ||
'\n' Text.Whitespace | ||
|
||
'>>> ' Generic.Prompt | ||
'with' Keyword | ||
' ' Text | ||
'p' Name | ||
':' Punctuation | ||
'\n' Text.Whitespace | ||
|
||
'... ' Generic.Prompt | ||
' ' Text | ||
'p' Name | ||
'.' Operator | ||
'map' Name | ||
'(' Punctuation | ||
'f' Name | ||
',' Punctuation | ||
' ' Text | ||
'[' Punctuation | ||
'1' Literal.Number.Integer | ||
',' Punctuation | ||
'2' Literal.Number.Integer | ||
',' Punctuation | ||
'3' Literal.Number.Integer | ||
']' Punctuation | ||
')' Punctuation | ||
'\n' Text.Whitespace | ||
|
||
'Process PoolWorker-1:\n' Generic.Output | ||
|
||
'Process PoolWorker-2:\n' Generic.Output | ||
|
||
'Process PoolWorker-3:\n' Generic.Output | ||
|
||
'Traceback (most recent call last):\n' Generic.Traceback | ||
|
||
'Traceback (most recent call last):\n' Generic.Traceback | ||
|
||
'Traceback (most recent call last):\n' Generic.Traceback | ||
|
||
'AttributeError' Generic.Error | ||
': ' Text | ||
"Can't get attribute 'f' on <module '__main__' (<class '_frozen_importlib.BuiltinImporter'>)>" Name | ||
'\n' Text.Whitespace | ||
|
||
"AttributeError: Can't get attribute 'f' on <module '__main__' (<class '_frozen_importlib.BuiltinImporter'>)>\n" Generic.Output | ||
|
||
"AttributeError: Can't get attribute 'f' on <module '__main__' (<class '_frozen_importlib.BuiltinImporter'>)>\n" Generic.Output |