comparison test/test_cgi.py @ 5248:198b6e810c67

Use Python-3-compatible 'as' syntax for except statements Many raise statements near these are also fixed. So are two ivorrect file encoding marks ('utf8'->'utf-8').
author Eric S. Raymond <esr@thyrsus.com>
date Thu, 24 Aug 2017 22:21:37 -0400
parents 8743b7226dc7
children efb34cbdba7c
comparison
equal deleted inserted replaced
5247:7f00a47b3559 5248:198b6e810c67
143 143
144 def tearDown(self): 144 def tearDown(self):
145 self.db.close() 145 self.db.close()
146 try: 146 try:
147 shutil.rmtree(self.dirname) 147 shutil.rmtree(self.dirname)
148 except OSError, error: 148 except OSError as error:
149 if error.errno not in (errno.ENOENT, errno.ESRCH): raise 149 if error.errno not in (errno.ENOENT, errno.ESRCH): raise
150 150
151 # 151 #
152 # form label extraction 152 # form label extraction
153 # 153 #
1597 1597
1598 def tearDown(self): 1598 def tearDown(self):
1599 self.db.close() 1599 self.db.close()
1600 try: 1600 try:
1601 shutil.rmtree(self.dirname) 1601 shutil.rmtree(self.dirname)
1602 except OSError, error: 1602 except OSError as error:
1603 if error.errno not in (errno.ENOENT, errno.ESRCH): raise 1603 if error.errno not in (errno.ENOENT, errno.ESRCH): raise
1604 1604
1605 def testrenderFrontPage(self): 1605 def testrenderFrontPage(self):
1606 self.client.renderFrontPage("hello world RaNdOmJunk") 1606 self.client.renderFrontPage("hello world RaNdOmJunk")
1607 # make sure we can find the "hello world RaNdOmJunk" 1607 # make sure we can find the "hello world RaNdOmJunk"
1786 1786
1787 def tearDown(self): 1787 def tearDown(self):
1788 self.db.close() 1788 self.db.close()
1789 try: 1789 try:
1790 shutil.rmtree(self.dirname) 1790 shutil.rmtree(self.dirname)
1791 except OSError, error: 1791 except OSError as error:
1792 if error.errno not in (errno.ENOENT, errno.ESRCH): raise 1792 if error.errno not in (errno.ENOENT, errno.ESRCH): raise
1793 1793
1794 def testTemplateSubdirectory(self): 1794 def testTemplateSubdirectory(self):
1795 # test for templates in subdirectories 1795 # test for templates in subdirectories
1796 1796

Roundup Issue Tracker: http://roundup-tracker.org/