From 60c406a7d6da71284a6e5eb9bc502fb20a26e505 Mon Sep 17 00:00:00 2001 From: glyph Date: Sat, 24 Jan 2015 07:37:17 +0000 Subject: [PATCH] Merge remove-udpclient-7702: remove UDPClient Author: eeshangarg Reviewer: glyph Fixes: #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 --- twisted/application/internet.py | 17 ++++------------- twisted/test/test_application.py | 17 ++--------------- twisted/topfiles/7702.removal | 1 + 3 files changed, 7 insertions(+), 28 deletions(-) create mode 100644 twisted/topfiles/7702.removal diff --git a/twisted/application/internet.py b/twisted/application/internet.py index b5d913d66ee..bcd183e1ece 100644 --- a/twisted/application/internet.py +++ b/twisted/application/internet.py @@ -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 @@ -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,), @@ -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 @@ -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()]) diff --git a/twisted/test/test_application.py b/twisted/test/test_application.py index 4d943ceceed..acb684c77cc 100644 --- a/twisted/test/test_application.py +++ b/twisted/test/test_application.py @@ -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 @@ -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] diff --git a/twisted/topfiles/7702.removal b/twisted/topfiles/7702.removal new file mode 100644 index 00000000000..8ab9d359671 --- /dev/null +++ b/twisted/topfiles/7702.removal @@ -0,0 +1 @@ +twisted.application.internet.UDPClient, deprecated since Twisted 13.1.0, has been removed.