mirror of
https://github.com/python/cpython.git
synced 2025-11-17 09:30:10 +00:00
Convert import try/except to use test_support.import_module().
This commit is contained in:
parent
3c87e2289d
commit
ad74dfe8ff
1 changed files with 3 additions and 6 deletions
|
|
@ -3,14 +3,11 @@
|
||||||
|
|
||||||
import os
|
import os
|
||||||
import time
|
import time
|
||||||
import unittest
|
|
||||||
from test.fork_wait import ForkWait
|
from test.fork_wait import ForkWait
|
||||||
from test.test_support import run_unittest, reap_children
|
from test.test_support import run_unittest, reap_children, import_module
|
||||||
|
|
||||||
|
import_module('os.fork')
|
||||||
|
|
||||||
try:
|
|
||||||
os.fork
|
|
||||||
except AttributeError:
|
|
||||||
raise unittest.SkipTest, "os.fork not defined -- skipping test_fork1"
|
|
||||||
|
|
||||||
class ForkTest(ForkWait):
|
class ForkTest(ForkWait):
|
||||||
def wait_impl(self, cpid):
|
def wait_impl(self, cpid):
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue