diff options
author | Guido van Rossum <guido@python.org> | 2001-10-24 20:42:55 (GMT) |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 2001-10-24 20:42:55 (GMT) |
commit | e2ae77b8b8a62e648bb1864a9b36ef3280984404 (patch) | |
tree | e03ad6f126a16529b2fb43671903e357bcb05835 /Lib/whichdb.py | |
parent | c6ac8a78f668123ec5c2c3d5a824e7886e9a1c60 (diff) | |
download | cpython-e2ae77b8b8a62e648bb1864a9b36ef3280984404.zip cpython-e2ae77b8b8a62e648bb1864a9b36ef3280984404.tar.gz cpython-e2ae77b8b8a62e648bb1864a9b36ef3280984404.tar.bz2 |
SF patch #474590 -- RISC OS support
Diffstat (limited to 'Lib/whichdb.py')
-rw-r--r-- | Lib/whichdb.py | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/Lib/whichdb.py b/Lib/whichdb.py index 8687b71..8b31003 100644 --- a/Lib/whichdb.py +++ b/Lib/whichdb.py @@ -2,11 +2,6 @@ import os -if os.sep==".": - endsep = "/" -else: - endsep = "." - def whichdb(filename): """Guess which db package to use to open a db file. @@ -24,9 +19,9 @@ def whichdb(filename): # Check for dbm first -- this has a .pag and a .dir file try: - f = open(filename + endsep + "pag", "rb") + f = open(filename + os.extsep + "pag", "rb") f.close() - f = open(filename + endsep + "dir", "rb") + f = open(filename + os.extsep + "dir", "rb") f.close() return "dbm" except IOError: @@ -34,9 +29,9 @@ def whichdb(filename): # Check for dumbdbm next -- this has a .dir and and a .dat file try: - f = open(filename + endsep + "dat", "rb") + f = open(filename + os.extsep + "dat", "rb") f.close() - f = open(filename + endsep + "dir", "rb") + f = open(filename + os.extsep + "dir", "rb") try: if f.read(1) in ["'", '"']: return "dumbdbm" |