if source.getByteStream() is None:
sysid = source.getSystemId()
- if os.path.isfile(sysid):
- basehead = os.path.split(os.path.normpath(base))[0]
- source.setSystemId(os.path.join(basehead, sysid))
- f = open(sysid, "rb")
+ basehead = os.path.split(os.path.normpath(base))[0]
+ sysidfilename = os.path.join(basehead, sysid)
+ if os.path.isfile(sysidfilename):
+ source.setSystemId(sysidfilename)
+ f = open(sysidfilename, "rb")
else:
source.setSystemId(urlparse.urljoin(base, sysid))
f = urllib.urlopen(source.getSystemId())