Skip to content

native_concat: pass only strings to literal_eval#1339

Merged
davidism merged 1 commit intopallets:masterfrom
mkrizek:issue-1335
Jan 28, 2021
Merged

native_concat: pass only strings to literal_eval#1339
davidism merged 1 commit intopallets:masterfrom
mkrizek:issue-1335

Conversation

@mkrizek
Copy link
Copy Markdown
Contributor

@mkrizek mkrizek commented Jan 28, 2021

If there is only single node and it is not a string, there is no point
in passing it into literal_eval, just return it immediately.

One of the examples where passing a non-string node into
literal_eval would actually cause problems is when the node is
Undefined. On Python 3.10 this would cause UndefinedError
instead of just Undefined being returned.

Fixes #1335

If there is only single node and it is not a string, there is no point
in passing it into ``literal_eval``, just return it immediately.

One of the examples where passing a non-string node into
``literal_eval`` would actually cause problems is when the node is
``Undefined``. On Python 3.10 this would cause ``UndefinedError``
instead of just ``Undefined`` being returned.

Fixes pallets#1335
@davidism davidism merged commit bc22a8b into pallets:master Jan 28, 2021
@mkrizek mkrizek deleted the issue-1335 branch January 28, 2021 14:28
@github-actions github-actions Bot locked as resolved and limited conversation to collaborators Feb 12, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

test_nativetypes failure with Python 3.10

2 participants