From: Skip Montanaro Date: Thu, 1 Mar 2001 04:13:51 +0000 (+0000) Subject: move import into function to avoid having to add an __all__ list... X-Git-Tag: v2.1b1~80 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=58eadbaf1289f8671e435fb3a00e9e0351abbc16;p=python move import into function to avoid having to add an __all__ list... --- diff --git a/Lib/whichdb.py b/Lib/whichdb.py index 4396321e99..1f120998d4 100644 --- a/Lib/whichdb.py +++ b/Lib/whichdb.py @@ -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")