Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 910b282

Browse files
committed
when only using half of the return value of os.path.split(), use
os.path.dirname() or os.path.basename() instead
1 parent 4ed315a commit 910b282

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

Lib/xml/sax/saxutils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,7 @@ def prepare_input_source(source, base = ""):
283283

284284
if source.getByteStream() is None:
285285
sysid = source.getSystemId()
286-
basehead = os.path.split(os.path.normpath(base))[0]
286+
basehead = os.path.dirname(os.path.normpath(base))
287287
sysidfilename = os.path.join(basehead, sysid)
288288
if os.path.isfile(sysidfilename):
289289
source.setSystemId(sysidfilename)

0 commit comments

Comments
 (0)