IGN:Fix timeout on windows when trying to open strage card

This commit is contained in:
Kovid Goyal 2009-05-02 10:49:03 -07:00
parent 8ca336696b
commit 133d1d761b

View File

@ -251,6 +251,10 @@ class PRS505(Device):
try: try:
cachep = os.path.join(self._card_prefix, self.CACHE_XML) cachep = os.path.join(self._card_prefix, self.CACHE_XML)
if not os.path.exists(cachep): if not os.path.exists(cachep):
try:
os.makedirs(os.path.dirname(cachep), mode=0777)
except:
time.sleep(5)
os.makedirs(os.path.dirname(cachep), mode=0777) os.makedirs(os.path.dirname(cachep), mode=0777)
f = open(cachep, 'wb') f = open(cachep, 'wb')
f.write(u'''<?xml version="1.0" encoding="UTF-8"?> f.write(u'''<?xml version="1.0" encoding="UTF-8"?>