← Back to team overview

launchpad-reviewers team mailing list archive

[Merge] ~cjwatson/txpkgupload:remove-defer-returnValue into txpkgupload:master

 

Colin Watson has proposed merging ~cjwatson/txpkgupload:remove-defer-returnValue into txpkgupload:master.

Commit message:
Stop using twisted.internet.defer.returnValue

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)

For more details, see:
https://code.launchpad.net/~cjwatson/txpkgupload/+git/txpkgupload/+merge/478062

`defer.returnValue` was only needed in Python 2; in Python 3, a simple
`return` is fine.

`twisted.internet.defer.returnValue` is deprecated as of Twisted 24.7.0.
-- 
Your team Launchpad code reviewers is requested to review the proposed merge of ~cjwatson/txpkgupload:remove-defer-returnValue into txpkgupload:master.
diff --git a/src/txpkgupload/tests/test_plugin.py b/src/txpkgupload/tests/test_plugin.py
index 20740d6..8179d54 100644
--- a/src/txpkgupload/tests/test_plugin.py
+++ b/src/txpkgupload/tests/test_plugin.py
@@ -96,7 +96,7 @@ class DeferringFixture(Fixture):
             else:
                 raise MultipleExceptions(*result)
         if not raise_first:
-            defer.returnValue(result)
+            return result
 
 
 class TestConfig(TestCase):
@@ -472,7 +472,7 @@ class SFTPServer(DeferringFixture):
         connector = reactor.connectTCP(host, self.port, factory)
         yield connecting
         client = yield conn._sftp
-        defer.returnValue(client)
+        return client
 
     def makeDirectory(self, client, path):
         return client.makeDirectory(path, {"permissions": 0o777})