Change more tests to use import_module for the modules that
should cause tests to be skipped.  Also rename import_function
to the more descriptive get_attribute and add a docstring.
diff --git a/Lib/test/test_bz2.py b/Lib/test/test_bz2.py
index 2f627c3..215a04e 100644
--- a/Lib/test/test_bz2.py
+++ b/Lib/test/test_bz2.py
@@ -1,6 +1,6 @@
 #!/usr/bin/python
 from test import test_support
-from test.test_support import TESTFN
+from test.test_support import TESTFN, import_module
 
 import unittest
 from cStringIO import StringIO
@@ -8,7 +8,7 @@
 import subprocess
 import sys
 
-import bz2
+bz2 = import_module('bz2')
 from bz2 import BZ2File, BZ2Compressor, BZ2Decompressor
 
 has_cmdline_bunzip2 = sys.platform not in ("win32", "os2emx", "riscos")