⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 276564 in webkit


Ignore:
Timestamp:
Apr 25, 2021, 10:39:58 AM (5 years ago)
Author:
commit-queue@webkit.org
Message:

jsonchecker.py validate_string uses Python 2 basestring type instead of Python 2/3 str type
https://bugs.webkit.org/show_bug.cgi?id=224978

Patch by Tyler Wilcock <Tyler Wilcock> on 2021-04-25
Reviewed by Darin Adler.

validate_string uses the Python 2 basestring type instead of the Python 2/3
str type. This causes the check to exit early the first time it validates
a string with this error:

name 'basestring' is not defined

This resulted in jsonchecker not checking the file beyond the first
string validation.

I believe this caused jsonchecker to miss a bug in one of my previous
patches in which I put the "settings-flag" property in the wrong
place:

https://bugs.webkit.org/show_bug.cgi?id=224718#c20

  • Scripts/webkitpy/style/checkers/jsonchecker.py:

(JSONCSSPropertiesChecker.validate_string):
validate_string with Python 2 / 3 str type instead of Python 2
basestring.

Location:
trunk/Tools
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Tools/ChangeLog

    r276561 r276564  
     12021-04-25  Tyler Wilcock  <twilco.o@protonmail.com>
     2
     3        jsonchecker.py validate_string uses Python 2 basestring type instead of Python 2/3 str type
     4        https://bugs.webkit.org/show_bug.cgi?id=224978
     5
     6        Reviewed by Darin Adler.
     7
     8        validate_string uses the Python 2 basestring type instead of the Python 2/3
     9        str type.  This causes the check to exit early the first time it validates
     10        a string with this error:
     11
     12        name 'basestring' is not defined
     13
     14        This resulted in jsonchecker not checking the file beyond the first
     15        string validation. 
     16
     17        I believe this caused jsonchecker to miss a bug in one of my previous
     18        patches in which I put the "settings-flag" property in the wrong
     19        place:
     20
     21        https://bugs.webkit.org/show_bug.cgi?id=224718#c20
     22
     23        * Scripts/webkitpy/style/checkers/jsonchecker.py:
     24        (JSONCSSPropertiesChecker.validate_string):
     25        validate_string with Python 2 / 3 str type instead of Python 2
     26        basestring.
     27
    1282021-04-24  Aakash Jain  <aakash_jain@apple.com>
    229
  • trunk/Tools/Scripts/webkitpy/style/checkers/jsonchecker.py

    r266683 r276564  
    165165
    166166    def validate_string(self, property_name, property_key, key, value):
    167         self.validate_type(property_name, property_key, key, value, basestring)
     167        self.validate_type(property_name, property_key, key, value, str)
    168168
    169169    def validate_array(self, property_name, property_key, key, value):
Note: See TracChangeset for help on using the changeset viewer.