]> git.ipfire.org Git - thirdparty/dnspython.git/commitdiff
Preserve Python 2.4 compatibility. 29/head
authorJeffrey C. Ollie <jeff@ocjtech.us>
Mon, 8 Jul 2013 05:35:22 +0000 (00:35 -0500)
committerJeffrey C. Ollie <jeff@ocjtech.us>
Mon, 8 Jul 2013 05:35:22 +0000 (00:35 -0500)
A new style of string formatting was introduced in Python 2.6.
Preserve Python 2.4 compatibility by switching back to the old style.

tests/grange.py

index cbfc896520fef8272a2b406d1f4ebf278015adb9..1bb7dbb217393f5f676d568a4eaab418f681264c 100644 (file)
@@ -72,7 +72,7 @@ class GRangeTestCase(unittest.TestCase):
             start = 2
             stop = 1
             step = 1
-            dns.grange.from_text('{0}-{1}/{2}'.format(start, stop, step))
+            dns.grange.from_text('%d-%d/%d' % (start, stop, step))
         self.assertRaises(AssertionError, bad)
 
     def testFailFromText2(self):
@@ -80,7 +80,7 @@ class GRangeTestCase(unittest.TestCase):
             start = '-1'
             stop = 3
             step = 1
-            dns.grange.from_text('{0}-{1}/{2}'.format(start, stop, step))
+            dns.grange.from_text('%s-%d/%d' % (start, stop, step))
         self.assertRaises(dns.exception.SyntaxError, bad)
 
     def testFailFromText2(self):
@@ -88,7 +88,7 @@ class GRangeTestCase(unittest.TestCase):
             start = 1
             stop = 4
             step = '-2'
-            dns.grange.from_text('{0}-{1}/{2}'.format(start, stop, step))
+            dns.grange.from_text('%d-%d/%s' % (start, stop, step))
         self.assertRaises(dns.exception.SyntaxError, bad)
 
 if __name__ == '__main__':