[Python-checkins] CVS: python/dist/src/Lib whichdb.py,1.6,1.7

Moshe Zadka python-dev@python.org
Fri, 28 Jul 2000 22:31:43 -0700


Update of /cvsroot/python/python/dist/src/Lib
In directory slayer.i.sourceforge.net:/tmp/cvs-serv25787

Modified Files:
	whichdb.py 
Log Message:
Added support to recognize Python's internal "dumbdbm" database.
This closes bug 200 on Jitterbug.


Index: whichdb.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/whichdb.py,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -r1.6 -r1.7
*** whichdb.py	2000/02/10 17:17:14	1.6
--- whichdb.py	2000/07/29 05:31:40	1.7
***************
*** 26,29 ****
--- 26,41 ----
          pass
  
+     # Check for dumbdbm next -- this has a .dir and and a .dat file
+         f = open(filename + ".dat", "rb")
+         f.close()
+         f = open(filename + ".dir", "rb")
+         try:
+             if f.read(1) in ["'", '"']:
+                 return "dumbdbm"
+         finally:
+             f.close()
+     except IOError:
+         pass
+ 
      # See if the file exists, return None if not
      try: