Opened 4 years ago

Closed 4 years ago

#4860 enhancement closed invalid (invalid)

Move an import statement to top of file.

Reported by: e000 Owned by:
Priority: low Milestone:
Component: core Keywords:
Cc: Branch:
Author: Launchpad Bug:

Description

On twisted.internet.task, we should move

    from twisted.internet import reactor

to the top of task.py

(_defaultScheduler, line 305)

Change History (2)

comment:1 Changed 4 years ago by exarkun

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

Importing the reactor has an unfortunate side-effect. If no reactor exists yet, then the default reactor is instantiated and installed. For this reason, modules in Twisted try to avoid importing the reactor as a side-effect of being imported themselves. Thus the reactor import hidden inside the _defaultScheduler function.

comment:2 Changed 4 years ago by <automation>

Note: See TracTickets for help on using tickets.