Ticket #6389: react-argv.patch

File react-argv.patch, 2.9 KB (added by Julian Berman, 7 years ago)
  • twisted/internet/task.py

    diff --git a/twisted/internet/task.py b/twisted/internet/task.py
    index e4c0490..dba1769 100644
    a b def deferLater(clock, delay, callable, *args, **kw): 
    798798
    799799
    800800
    801 def react(main, argv, _reactor=None):
     801def react(main, argv=(), _reactor=None):
    802802    """
    803803    Call C{main} and run the reactor until the L{Deferred} it returns fires.
    804804
  • twisted/test/test_task.py

    diff --git a/twisted/test/test_task.py b/twisted/test/test_task.py
    index 9de3c3c..e28ce92 100644
    a b class ReactTests(unittest.SynchronousTestCase): 
    839839            return finished
    840840        r = _FakeReactor()
    841841        exitError = self.assertRaises(
    842             SystemExit, task.react, main, [], _reactor=r)
     842            SystemExit, task.react, main, _reactor=r)
    843843        self.assertEqual(0, exitError.code)
    844844        self.assertEqual(timePassed, [True])
    845845        self.assertEqual(r.seconds(), 2)
    class ReactTests(unittest.SynchronousTestCase): 
    855855            return defer.succeed(None)
    856856        r = _FakeReactor()
    857857        exitError = self.assertRaises(
    858             SystemExit, task.react, main, [], _reactor=r)
     858            SystemExit, task.react, main, _reactor=r)
    859859        self.assertEqual(0, exitError.code)
    860860        self.assertEqual(r.seconds(), 0)
    861861
    class ReactTests(unittest.SynchronousTestCase): 
    875875            return finished
    876876        r = _FakeReactor()
    877877        exitError = self.assertRaises(
    878             SystemExit, task.react, main, [], _reactor=r)
     878            SystemExit, task.react, main, _reactor=r)
    879879
    880880        self.assertEqual(1, exitError.code)
    881881
    class ReactTests(unittest.SynchronousTestCase): 
    896896            return defer.fail(ExpectedException())
    897897        r = _FakeReactor()
    898898        exitError = self.assertRaises(
    899             SystemExit, task.react, main, [], _reactor=r)
     899            SystemExit, task.react, main, _reactor=r)
    900900        self.assertEqual(1, exitError.code)
    901901        self.assertEqual(r.seconds(), 0)
    902902        errors = self.flushLoggedErrors(ExpectedException)
    class ReactTests(unittest.SynchronousTestCase): 
    917917            return finished
    918918        r = _FakeReactor()
    919919        exitError = self.assertRaises(
    920             SystemExit, task.react, main, [], _reactor=r)
     920            SystemExit, task.react, main, _reactor=r)
    921921        self.assertEqual(r.seconds(), 1)
    922922
    923923        self.assertEqual(0, exitError.code)
    class ReactTests(unittest.SynchronousTestCase): 
    940940            return finished
    941941        r = _FakeReactor()
    942942        exitError = self.assertRaises(
    943             SystemExit, task.react, main, [], _reactor=r)
     943            SystemExit, task.react, main, _reactor=r)
    944944
    945945        self.assertEqual(1, exitError.code)
    946946