]> granicus.if.org Git - python/commitdiff
move import into function to avoid having to add an __all__ list...
authorSkip Montanaro <skip@pobox.com>
Thu, 1 Mar 2001 04:13:51 +0000 (04:13 +0000)
committerSkip Montanaro <skip@pobox.com>
Thu, 1 Mar 2001 04:13:51 +0000 (04:13 +0000)
Lib/whichdb.py

index 4396321e991d6effa0ebeb79b1db8d03020ead2d..1f120998d479182b9f94451ebf287aa5b400db74 100644 (file)
@@ -1,7 +1,5 @@
 """Guess which db package to use to open a db file."""
 
-import struct
-
 def whichdb(filename):
     """Guess which db package to use to open a db file.
 
@@ -15,6 +13,8 @@ def whichdb(filename):
     database using that module may still fail.
     """
 
+    import struct
+
     # Check for dbm first -- this has a .pag and a .dir file
     try:
         f = open(filename + ".pag", "rb")