Ticket #5860 task closed fixed

Opened 21 months ago

Last modified 20 months ago

Remove twisted.python.threadable's dependency on twisted.python.hook

Reported by: itamar Owned by: itamar
Priority: normal Milestone: Python 3.3 Minimal
Component: core Keywords:
Cc: Branch: branches/unhook-threadable-5860
(diff, github, buildbot, log)
Author: exarkun Launchpad Bug:

Description

threadable.synchronize is the only code in Twisted that depends on hook. Rewriting it to not use hook would mean less code to port to Python 3.

Change History

1

Changed 20 months ago by exarkun

  • status changed from new to assigned
  • owner changed from itamar to exarkun

2

Changed 20 months ago by exarkun

  • branch set to branches/unhook-threadable-5860
  • branch_author set to exarkun

(In [35477]) Branching to 'unhook-threadable-5860'

3

Changed 20 months ago by exarkun

(In [35478]) Re-implement threadable.synchronize with a function wrapper instead of a hook

refs #5860

4

Changed 20 months ago by exarkun

  • owner exarkun deleted
  • keywords review added
  • status changed from assigned to new

Removed the dependency and ported threadable to Python 3. The astute reader will notice that synchronize is a class decorator.

 Build results

5

Changed 20 months ago by itamar

  • keywords review removed
  • owner set to itamar
  1. You can't raise unittest.FailTest in Python 3. Since this only happens if the test fails, it just means the failure (which doesn't happen since the code is correct) is obscured. #5885 will fix this, so I don't think this worth fixing.
  2. Not depending on reactor is good.
  3. I opened a ticket to improve testing of the synchronize decorator (#5938).

I note that Twisted cannot run without threading being available (since twisted.python.context uses it for example), so perhaps another ticket should be filed for simplifying the module. Not that we'll ever get around to it.

So, looks good. I will merge.

6

Changed 20 months ago by itamarst

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

(In [35498]) Merge unhook-threadable-5860

Author: exarkun Review: itamar Fixes: #5860

Port twisted.python.threadable to Python 3.

Note: See TracTickets for help on using tickets.