Summary: | webkitpy __init__.py (webkit-patch) should detect python < 2.5 and show a nice error message | ||||||
---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Eric Seidel (no email) <eric> | ||||
Component: | Tools / Tests | Assignee: | Chris Jerdonek <cjerdonek> | ||||
Status: | RESOLVED FIXED | ||||||
Severity: | Normal | CC: | abarth, cjerdonek, ddkilzer, dglazkov, fishd, levin, tony | ||||
Priority: | P2 | ||||||
Version: | 528+ (Nightly build) | ||||||
Hardware: | PC | ||||||
OS: | OS X 10.5 | ||||||
Bug Depends on: | 35788, 35828 | ||||||
Bug Blocks: | |||||||
Attachments: |
|
Description
Eric Seidel (no email)
2009-11-16 01:31:34 PST
Would it be hard to just support python2.4? I don't really like python's ternary syntax anyway. If you want to detect version, you can use sys.version_info. Solution 1 isn’t a good idea since it’ll break for folks that only have Python > 2.5. I'm not sure how difficult it would be support 2.4. I'd have to check what other features we depend on. For future reference, here is a case of code breaking with Python 2.5: https://bugs.webkit.org/show_bug.cgi?id=33365#c9 Maybe test-webkitpy should issue a warning if run using Python 2.6+. Created attachment 50180 [details] Proposed patch I didn't add any information about how to upgrade. Perhaps we can simply include a link to this wiki page, and include instructions there: http://trac.webkit.org/wiki/PythonGuidelines Let me know your preference. Also, note that pending patches in the following two reports are required for this patch to work: https://bugs.webkit.org/show_bug.cgi?id=35828 https://bugs.webkit.org/show_bug.cgi?id=35788 So the style bot may not work. Also marking cq- for that reason. Comment on attachment 50180 [details]
Proposed patch
I'm not wild about the name "patcher.py".
We've discussed the issue of python version requirements a bunch. I'm not 100% sure what the final resolution was, but this patch is just making the code print a nicer error message. If we want to support older versions of Python, we can still do that.
(In reply to comment #6) > (From update of attachment 50180 [details]) > I'm not wild about the name "patcher.py". Agreed. We can rename in a later patch. I mainly wanted to choose something without "webkit" in the name since it's redundant with being in webkitpy. Naming the main lead-in file for a package main.py might be a good way to go. But that didn't quite seem to fit here since the module does more than expose a main method -- it defines a substantive class. > We've discussed the issue of python version requirements a bunch. I'm not 100% > sure what the final resolution was, but this patch is just making the code > print a nicer error message. If we want to support older versions of Python, > we can still do that. Exactly. Hopefully we'll get clarification on that soon. I might prod the list again on Monday -- this time with an attempted summary. Manually committed (via git svn dcommit): http://trac.webkit.org/changeset/55972 |