Skip to content

Conversation

@lygstate
Copy link
Contributor

indent are using to do arithmetic compare
leading < indent, and None can't do that.

JerryScript-DCO-1.0-Signed-off-by: Yonggang Luo luoyonggang@gmail.com

@akosthekiss
Copy link
Member

Note that this is another py 2vs3 issue:

$ python2 -c "print(1 < None)"
False
$ python3 -c "print(1 < None)"
Traceback (most recent call last):
  File "<string>", line 1, in <module>
TypeError: '<' not supported between instances of 'int' and 'NoneType'

@lygstate
Copy link
Contributor Author

Note that this is another py 2vs3 issue:

$ python2 -c "print(1 < None)"
False
$ python3 -c "print(1 < None)"
Traceback (most recent call last):
  File "<string>", line 1, in <module>
TypeError: '<' not supported between instances of 'int' and 'NoneType'

Yeap, I am using python3 to running the script, python2 are on the way to gone

Copy link
Member

@akosthekiss akosthekiss left a comment

Choose a reason for hiding this comment

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

LGTM (note that I've edited the commit message as a maintainer and force-pushed)

@akosthekiss akosthekiss changed the title Using indent=0 instead None Make test262-harness.py Python 3-compatible Dec 29, 2020
@akosthekiss
Copy link
Member

For the records, the following traceback was in the original commit message:

Traceback (most recent call last):
  File "C:\work\study\languages\typescript\jerryscript\tools\runners\test262-harness.py", line 937, in <module>
    sys.exit(main())
  File "C:\work\study\languages\typescript\jerryscript\tools\runners\test262-harness.py", line 925, in main
    code = test_suite.run(options.command, args,
  File "C:\work\study\languages\typescript\jerryscript\tools\runners\test262-harness.py", line 825, in run
    cases = self.enumerate_tests(tests, command_template)
  File "C:\work\study\languages\typescript\jerryscript\tools\runners\test262-harness.py", line 772, in enumerate_tests
    strict_case = TestCase(self, name, full_path, True, command_template)
  File "C:\work\study\languages\typescript\jerryscript\tools\runners\test262-harness.py", line 487, in __init__
    test_record = parse_test_record(self.contents, name)
  File "C:\work\study\languages\typescript\jerryscript\tools\runners\test262-harness.py", line 314, in parse_test_record
    yaml_attr_parser(test_record, attrs, name, onerror)
  File "C:\work\study\languages\typescript\jerryscript\tools\runners\test262-harness.py", line 245, in yaml_attr_parser
    parsed = yaml_load(attrs)
  File "C:\work\study\languages\typescript\jerryscript\tools\runners\test262-harness.py", line 70, in yaml_load
    return my_read_dict(string.splitlines())[1]
  File "C:\work\study\languages\typescript\jerryscript\tools\runners\test262-harness.py", line 94, in my_read_dict
    (lines, value) = my_read_value(lines, value, indent)
  File "C:\work\study\languages\typescript\jerryscript\tools\runners\test262-harness.py", line 117, in my_read_value
    return my_multiline_list(lines, value)
  File "C:\work\study\languages\typescript\jerryscript\tools\runners\test262-harness.py", line 139, in my_multiline_list
    elif leading < indent:
TypeError: '<' not supported between instances of 'int' and 'NoneType'

@ossy-szeged
Copy link
Contributor

LGTM (informal)

@rerobika
Copy link
Member

Please rebase.

Less operator is not supported between int and None in Python 3. Fix
that Python 2 legacy in test262-harness.py.

JerryScript-DCO-1.0-Signed-off-by: Yonggang Luo luoyonggang@gmail.com
@lygstate
Copy link
Contributor Author

rebased

Copy link
Member

@rerobika rerobika left a comment

Choose a reason for hiding this comment

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

LGTM

@rerobika rerobika merged commit 2faafa4 into jerryscript-project:master Dec 30, 2020
@lygstate lygstate deleted the indent-is-number branch December 30, 2020 15:09
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.

4 participants