mirror of
https://github.com/python/cpython.git
synced 2024-11-29 21:05:33 +08:00
Don't use a file object as system id; try to propagate the file name to
the InputSource.
This commit is contained in:
parent
2aa93efda0
commit
5fece7fc1b
@ -203,8 +203,10 @@ def prepare_input_source(source, base = ""):
|
||||
source = xmlreader.InputSource(source)
|
||||
elif hasattr(source, "read"):
|
||||
f = source
|
||||
source = xmlreader.InputSource(source)
|
||||
source = xmlreader.InputSource()
|
||||
source.setByteStream(f)
|
||||
if hasattr(f, "name"):
|
||||
f.setSystemId(f.name)
|
||||
|
||||
if source.getByteStream() is None:
|
||||
sysid = source.getSystemId()
|
||||
|
Loading…
Reference in New Issue
Block a user