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

Tools: Update PyYAML version. #2279

Merged
merged 1 commit into from Aug 12, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 3 additions & 3 deletions tools/generation/lib/template.py
Expand Up @@ -154,20 +154,20 @@ def _frontmatter(self, case_filename, case_values):
features += self.attribs['meta'].get('features', [])
features = list(OrderedDict.fromkeys(features))
if len(features):
lines += ['features: ' + re.sub('\n\s*', ' ', yaml.dump(features).strip())]
lines += ['features: ' + re.sub('\n\s*', ' ', yaml.dump(features, default_flow_style=True).strip())]
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Default changed in yaml/pyyaml#256.

Copy link
Member

Choose a reason for hiding this comment

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

It is weird how the library picks an option where a default option needs to explicitly set as True. The actual default action is without the default option is the equivalent of False. Sounds very counterintuitive.

Anyway, it's not a problem of Test262 and thanks for fixing this up.


flags = ['generated']
flags += case_values['meta'].get('flags', [])
flags += self.attribs['meta'].get('flags', [])
flags = list(OrderedDict.fromkeys(flags))
lines += ['flags: ' + re.sub('\n\s*', ' ', yaml.dump(flags).strip())]
lines += ['flags: ' + re.sub('\n\s*', ' ', yaml.dump(flags, default_flow_style=True).strip())]

includes = []
includes += case_values['meta'].get('includes', [])
includes += self.attribs['meta'].get('includes', [])
includes = list(OrderedDict.fromkeys(includes))
if len(includes):
lines += ['includes: ' + re.sub('\n\s*', ' ', yaml.dump(includes).strip())]
lines += ['includes: ' + re.sub('\n\s*', ' ', yaml.dump(includes, default_flow_style=True).strip())]

if case_values['meta'].get('negative'):
if self.attribs['meta'].get('negative'):
Expand Down
2 changes: 1 addition & 1 deletion tools/generation/requirements.txt
@@ -1 +1 @@
PyYAML==3.11
PyYAML==5.1.2
2 changes: 1 addition & 1 deletion tools/lint/lib/checks/harnessfeatures.py
Expand Up @@ -9,7 +9,7 @@ class CheckHarnessFeatures(Check):

def __init__(self):
with open('./harness/features.yml', 'r') as f:
self.include_has_features = yaml.load(f.read())
self.include_has_features = yaml.safe_load(f.read())

def comparison_result_lists(self, meta):

Expand Down
2 changes: 1 addition & 1 deletion tools/lint/lib/frontmatter.py
Expand Up @@ -11,6 +11,6 @@ def parse(src):
return None

try:
return yaml.load(match.group(1))
return yaml.safe_load(match.group(1))
except (yaml.scanner.ScannerError, yaml.parser.ParserError):
return None
2 changes: 1 addition & 1 deletion tools/lint/requirements.txt
@@ -1,2 +1,2 @@
PyYAML==3.11
PyYAML==5.1.2
inflect==0.2.5