Преглед изворни кода

Refs #16682 -- Replaced signal number with equivalent signal.SIGINT.

Mariusz Felisiak пре 8 година
родитељ
комит
d391b3a85b
1 измењених фајлова са 3 додато и 2 уклоњено
  1. 3 2
      tests/transactions/tests.py

+ 3 - 2
tests/transactions/tests.py

@@ -1,6 +1,7 @@
 from __future__ import unicode_literals
 
 import os
+import signal
 import sys
 import threading
 import time
@@ -225,8 +226,8 @@ class AtomicTests(TransactionTestCase):
             with transaction.atomic():
                 Reporter.objects.create(first_name='Tintin')
                 # Send SIGINT (simulate Ctrl-C). One call isn't enough.
-                os.kill(os.getpid(), 2)
-                os.kill(os.getpid(), 2)
+                os.kill(os.getpid(), signal.SIGINT)
+                os.kill(os.getpid(), signal.SIGINT)
         except KeyboardInterrupt:
             pass
         self.assertEqual(Reporter.objects.all().count(), 0)