Skip to content

Commit

Permalink
Merge remove-udpclient-7702: remove UDPClient
Browse files Browse the repository at this point in the history
Author: eeshangarg

Reviewer: glyph

Fixes: twisted#7702

Remove twisted.application.internet.UDPClient, deprecated since Twisted 13.1.0.

git-svn-id: svn://svn.twistedmatrix.com/svn/Twisted/trunk@43728 bbbe8e31-12d6-0310-92fd-ac37d47ddeeb
  • Loading branch information
glyph committed Jan 24, 2015
1 parent 193adfe commit 60c406a
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 28 deletions.
17 changes: 4 additions & 13 deletions twisted/application/internet.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,6 @@
"""

from twisted.python import log
from twisted.python.deprecate import deprecatedModuleAttribute
from twisted.python.versions import Version
from twisted.application import service
from twisted.internet import task

Expand Down Expand Up @@ -209,6 +207,8 @@ def _getConnection(self):
for side in 'Server Client'.split():
if tran == "Multicast" and side == "Client":
continue
if tran == "UDP" and side == "Client":
continue
base = globals()['_Abstract'+side]
doc = _doc[side] % vars()
klass = types.ClassType(tran+side, (base,),
Expand All @@ -217,15 +217,6 @@ def _getConnection(self):



deprecatedModuleAttribute(
Version("Twisted", 13, 1, 0),
"It relies upon IReactorUDP.connectUDP "
"which was removed in Twisted 10. "
"Use twisted.application.internet.UDPServer instead.",
"twisted.application.internet", "UDPClient")



class TimerService(_VolatileDataService):
"""
Service to periodically call a function
Expand Down Expand Up @@ -399,7 +390,7 @@ def stop(passthrough):


__all__ = (['TimerService', 'CooperatorService', 'MulticastServer',
'StreamServerEndpointService'] +
'StreamServerEndpointService', 'UDPServer'] +
[tran+side
for tran in 'TCP UNIX SSL UDP UNIXDatagram'.split()
for tran in 'TCP UNIX SSL UNIXDatagram'.split()
for side in 'Server Client'.split()])
17 changes: 2 additions & 15 deletions twisted/test/test_application.py
Original file line number Diff line number Diff line change
Expand Up @@ -358,21 +358,6 @@ def onStop(ignored):
return defer.maybeDeferred(t.stopService).addCallback(onStop)


def test_deprecatedUDPClient(self):
"""
L{internet.UDPClient} is deprecated since Twisted-13.1.
"""
internet.UDPClient
warningsShown = self.flushWarnings([self.test_deprecatedUDPClient])
self.assertEqual(1, len(warningsShown))
self.assertEqual(
"twisted.application.internet.UDPClient was deprecated in "
"Twisted 13.1.0: It relies upon IReactorUDP.connectUDP "
"which was removed in Twisted 10. "
"Use twisted.application.internet.UDPServer instead.",
warningsShown[0]['message'])


def testPrivileged(self):
factory = protocol.ServerFactory()
factory.protocol = TestEcho
Expand Down Expand Up @@ -520,6 +505,8 @@ def test_everythingThere(self):
for side in 'Server Client'.split():
if tran == "Multicast" and side == "Client":
continue
if tran == "UDP" and side == "Client":
continue
self.assertTrue(hasattr(internet, tran + side))
method = getattr(internet, tran + side).method
prefix = {'Server': 'listen', 'Client': 'connect'}[side]
Expand Down
1 change: 1 addition & 0 deletions twisted/topfiles/7702.removal
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
twisted.application.internet.UDPClient, deprecated since Twisted 13.1.0, has been removed.

0 comments on commit 60c406a

Please sign in to comment.