Ticket #5809: 5809.2.patch

File 5809.2.patch, 933 bytes (added by moijes12, 2 years ago)
  • twisted/mail/test/test_mail.py

     
    199199        for line in contents.splitlines(): 
    200200            self.fp.lineReceived(line) 
    201201        self.fp.eomReceived() 
    202         self.assertEqual(file(self.final).read(), contents) 
     202        self.assertEqual(FilePath(self.final).open().read(), contents) 
    203203 
    204204    def test_interrupted(self): 
    205205        contents = "first line\nsecond line\n" 
     
    863863        self.messageFiles = [] 
    864864        for i in range(10): 
    865865            name = self.tmpdir.child('body-%d' % (i,)).path 
    866             with FilePath(name + '-H').open('wb') as f: 
     866            with FilePath(name + '-H').open('w') as f: 
    867867                pickle.dump(['from-%d' % (i,), 'to-%d' % (i,)], f) 
    868868 
    869869            f = FilePath(name + '-D').open('w')