#5973 enhancement closed fixed (fixed)

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
(diff, github, buildbot, log)
Author: itamarst Launchpad Bug:

Description

twisted.internet.main should run on Python 3.

Change History (9)

comment:1 Changed 23 months ago by itamarst

  • Author set to itamarst
  • Branch set to branches/imain-py3-5973

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

comment:2 Changed 23 months ago by itamar

  • Keywords review added
  • Owner changed from itamar to exarkun

comment:3 Changed 23 months ago by exarkun

  • Keywords review removed
  • Owner changed from exarkun to itamar
  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.

comment:4 Changed 23 months ago by itamarst

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

comment:5 Changed 23 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'

comment:6 Changed 23 months ago by itamarst

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

comment:7 Changed 23 months ago by itamar

  • Keywords review added
  • Owner changed from itamar to exarkun

comment:8 Changed 23 months ago by exarkun

  • Keywords review removed
  • Owner changed from exarkun to itamar
  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.

comment:9 Changed 23 months ago by itamarst

  • Resolution set to fixed
  • Status changed from new to closed

(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.