Opened 7 years ago

Closed 5 years ago

#4305 enhancement closed duplicate (duplicate)

python/version.py: Remove py3k deprecation warnngs when running twisted/test

Reported by: drtimcouper Owned by: drtimcouper
Priority: normal Milestone: Python-3.x
Component: core Keywords:
Cc: Thijs Triemstra Branch:
Author:

Attachments (3)

3k-python-version-4305.patch (8.7 KB) - added by drtimcouper 7 years ago.
pre-4305.txt (261 bytes) - added by drtimcouper 7 years ago.
errors that occur before patch installed
post-4305.txt (601 bytes) - added by drtimcouper 7 years ago.
errors that occur after patch installed

Download all attachments as: .zip

Change History (7)

Changed 7 years ago by drtimcouper

Changed 7 years ago by drtimcouper

Attachment: pre-4305.txt added

errors that occur before patch installed

Changed 7 years ago by drtimcouper

Attachment: post-4305.txt added

errors that occur after patch installed

comment:1 Changed 7 years ago by drtimcouper

Keywords: review added
Owner: Glyph deleted

The patch wold appear to be a faithful reworking of the non-3k elements, but I cannot reconcile the difference in errors arising when

c> python -3 bin/trial trial/test

is run.

Data above is from windows 7 ..

comment:2 Changed 7 years ago by Jean-Paul Calderone

Keywords: review removed
Owner: set to drtimcouper
  1. Rewriting all the __cmp__ methods in Twisted like this is going to be somewhat tedious, I suppose. It would probably be a good idea to define a mixin class, say SimpleComparionsMixin, which defines all six of the newer style comparison methods and calls its own __cmp__-like method (but not actually named that, otherwise we keep getting the warning) to determine their results. This should suppress the warning with minimal changes to all the __cmp__-defining classes. This comment probably applies to the changes of #4301 as well.
  2. The improved test coverage looks great. It might be better to use <, >, etc rather than directly calling the special method, though?
  3. Test methods should be named like test_camelCase.

I'm not sure about the test method failures you mentioned. If it's still a problem after implementing the above suggestions, I'll take a closer look.

comment:3 Changed 7 years ago by Thijs Triemstra

Cc: Thijs Triemstra added
Milestone: Python-3.x

comment:4 Changed 5 years ago by Thijs Triemstra

Description: modified (diff)
Resolution: duplicate
Status: newclosed

This became a duplicate of #5627, replacing the usage of cmp.

Note: See TracTickets for help on using tickets.