mirror of
https://github.com/python/cpython.git
synced 2025-08-30 21:48:47 +00:00
SF patch #474590 -- RISC OS support
This commit is contained in:
parent
c6ac8a78f6
commit
e2ae77b8b8
33 changed files with 256 additions and 188 deletions
|
@ -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"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue