Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

skip ValueError for long, list and dict type; #1085

Closed
wants to merge 5 commits into from
Closed

skip ValueError for long, list and dict type; #1085

wants to merge 5 commits into from

Conversation

vany-egorov
Copy link

@vany-egorov vany-egorov commented Jan 5, 2017

skip ValueError for long, list and dict type;
refs yarnpkg/yarn#2286
refs yarnpkg/yarn#2376

@@ -1222,6 +1222,8 @@ def ProcessVariablesAndConditionsInDict(the_dict, phase, variables_in,
# Skip "variables", which was already processed if present.
if key != 'variables' and type(value) is str:
expanded = ExpandVariables(value, phase, variables, build_file)
if type(expanded) in (long, list, dict):
continue
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't look self-evidently correct to me. What is yarn doing that npm doesn't that causes ExpandVariables to return unexpected types? long is acceptable because int is accepted but why list and dict? With what keys do you get those?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems I answered that question 8 months ago in #903 (comment)... I suppose the question then becomes whether this is the only ExpandVariables call site that needs updating.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added extra debug lines.
I got only long. No list or dict.

[
  {"type(expanded)": "<type 'long'>", "expanded": "1483986851164", "value": "1483986851164", "phase": "0", "build_file": "binding.gyp"}
  {"type(expanded)": "<type 'long'>", "expanded": "1483986851164", "value": "1483986851164", "phase": "0", "build_file": "deps\\libexpat\\libexpat.gyp"}
]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants