Changeset 162250 in webkit


Ignore:
Timestamp:
Jan 18, 2014 1:04:36 AM (10 years ago)
Author:
zandobersek@gmail.com
Message:

Inspector scripts are not compatible with Python v3
https://bugs.webkit.org/show_bug.cgi?id=127128

Reviewed by Benjamin Poulain.

  • inspector/scripts/generate-combined-inspector-json.py: Turn print statements into print function calls.
  • inspector/scripts/jsmin.py: Try importing the StringIO class from the StringIO module (which will work for

Python v2) or, on import error, import the class from the io module (which will work for Python v3).

Location:
trunk/Source/JavaScriptCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/ChangeLog

    r162209 r162250  
     12014-01-18  Zan Dobersek  <zdobersek@igalia.com>
     2
     3        Inspector scripts are not compatible with Python v3
     4        https://bugs.webkit.org/show_bug.cgi?id=127128
     5
     6        Reviewed by Benjamin Poulain.
     7
     8        * inspector/scripts/generate-combined-inspector-json.py: Turn print statements into print function calls.
     9        * inspector/scripts/jsmin.py: Try importing the StringIO class from the StringIO module (which will work for
     10        Python v2) or, on import error, import the class from the io module (which will work for Python v3).
     11
    1122014-01-17  Anders Carlsson  <andersca@apple.com>
    213
  • trunk/Source/JavaScriptCore/inspector/scripts/generate-combined-inspector-json.py

    r160557 r162250  
    3030
    3131if len(sys.argv) < 2:
    32     print "usage: %s [json files or directory of json files ...]" % os.path.basename(sys.argv[0])
     32    print("usage: %s [json files or directory of json files ...]" % os.path.basename(sys.argv[0]))
    3333    sys.exit(1)
    3434
     
    4848
    4949first = True
    50 print "{\"domains\":["
     50print("{\"domains\":[")
    5151for file in files:
    5252    if first:
    5353        first = False
    5454    else:
    55         print ","
     55        print(",")
    5656
    5757    string = open(file).read()
     
    6565        raise
    6666
    67     print string.rstrip()
    68 print "]}"
     67    print(string.rstrip())
     68print("]}")
  • trunk/Source/JavaScriptCore/inspector/scripts/jsmin.py

    r161563 r162250  
    3131# */
    3232
    33 from StringIO import StringIO
     33# Import StringIO from either the StringIO module (Python 2.x) or the io module (Python 3.x).
     34try:
     35    from StringIO import StringIO
     36except ImportError:
     37    from io import StringIO
    3438
    3539def jsmin(js):
Note: See TracChangeset for help on using the changeset viewer.