Ticket #5973 enhancement closed fixed

Opened 8 months ago

Last modified 8 months ago

Port twisted.internet.main to Python 3

Reported by: itamar Owned by: itamar
Priority: normal Milestone: Python 3.3 Minimal
Component: core Keywords:
Cc: Branch: branches/imain-py3-5973-2
Author: itamarst Launchpad Bug:

Description

twisted.internet.main should run on Python 3.

Change History

1

Changed 8 months ago by itamarst

  • branch set to branches/imain-py3-5973
  • branch_author set to itamarst

(In [35633]) Branching to 'imain-py3-5973'

2

Changed 8 months ago by itamar

  • owner changed from itamar to exarkun
  • keywords review added

3

Changed 8 months ago by exarkun

  • owner changed from exarkun to itamar
  • keywords review removed
  1. Add future imports to twisted/internet/main.py
  2. Relying on addCleanup to put the original reactor back makes me nervous. What code is going to run between the test method returning and the addCleanup functions running? What if it tries to import twisted.internet.reactor? It seems safer to me to restore sys.modules['twisted.internet.reactor'] before the test method returns. (In fact, I wrote a utility for doing this in #5935 which I guess is basically ready to be merged.)
  3. I don't understand the try/except or the new comment in test_alreadyInstalled.

4

Changed 8 months ago by itamarst

(In [35650]) Address review comments 1 and 3. Refs #5973

5

Changed 8 months ago by itamarst

  • branch changed from branches/imain-py3-5973 to branches/imain-py3-5973-2

(In [35651]) Branching to 'imain-py3-5973-2'

6

Changed 8 months ago by itamarst

(In [35653]) Address review comment 2. Refs #5973

7

Changed 8 months ago by itamar

  • keywords review added
  • owner changed from itamar to exarkun

8

Changed 8 months ago by exarkun

  • owner changed from exarkun to itamar
  • keywords review removed
  1. Shouldn't NoReactor.__enter__ also delete twisted.internet.reactor if it exists? Also, I think self._currentReactor is synonymous with self.modules["twisted.internet.reactor"].

Looks good otherwise, please merge when you're happy with that one point.

9

Changed 8 months ago by itamarst

  • status changed from new to closed
  • resolution set to fixed

(In [35665]) Merge imain-py3-5973-2.

Author: itamar Review: exarkun Fixes: #5973

Port twisted.internet.main to Python 3.

Note: See TracTickets for help on using tickets.