mirror of https://github.com/pypa/pip
handle missing trailing newline in uninstall_pth
This commit is contained in:
parent
b9feb191a9
commit
b1f949a816
|
@ -430,6 +430,9 @@ class UninstallPthEntries(object):
|
||||||
endline = '\r\n'
|
endline = '\r\n'
|
||||||
else:
|
else:
|
||||||
endline = '\n'
|
endline = '\n'
|
||||||
|
# handle missing trailing newline
|
||||||
|
if lines and not lines[-1].endswith(endline.encode("utf-8")):
|
||||||
|
lines[-1] = lines[-1] + endline.encode("utf-8")
|
||||||
for entry in self.entries:
|
for entry in self.entries:
|
||||||
try:
|
try:
|
||||||
logger.debug('Removing entry: %s', entry)
|
logger.debug('Removing entry: %s', entry)
|
||||||
|
|
Loading…
Reference in New Issue