0
0
mirror of https://github.com/vim/vim.git synced 2025-11-16 23:24:03 -05:00

updated for version 7.3.1226

Problem:    Python: duplicate code.
Solution:   Share code between OutputWrite() and OutputWritelines(). (ZyX)
This commit is contained in:
Bram Moolenaar
2013-06-23 12:51:32 +02:00
parent 3dbcd0c7ad
commit 6c85e7f3be
4 changed files with 26 additions and 30 deletions

View File

@@ -444,7 +444,7 @@ sys.stdout.attr = None:AttributeError:('invalid attribute',)
sys.stdout.write(None):TypeError:('coercing to Unicode: need string or buffer, NoneType found',)
>> OutputWriteLines
sys.stdout.writelines(None):TypeError:("'NoneType' object is not iterable",)
sys.stdout.writelines([1]):TypeError:('writelines() requires list of strings',)
sys.stdout.writelines([1]):TypeError:('coercing to Unicode: need string or buffer, int found',)
> VimCommand
vim.command(1):TypeError:('must be string, not int',)
> VimToPython

View File

@@ -433,7 +433,7 @@ sys.stdout.attr = None:(<class 'AttributeError'>, AttributeError('invalid attrib
sys.stdout.write(None):(<class 'TypeError'>, TypeError("Can't convert 'NoneType' object to str implicitly",))
>> OutputWriteLines
sys.stdout.writelines(None):(<class 'TypeError'>, TypeError("'NoneType' object is not iterable",))
sys.stdout.writelines([1]):(<class 'TypeError'>, TypeError('writelines() requires list of strings',))
sys.stdout.writelines([1]):(<class 'TypeError'>, TypeError("Can't convert 'int' object to str implicitly",))
>>> Testing *Iter* using sys.stdout.writelines(%s)
sys.stdout.writelines(FailingIter()):(<class 'NotImplementedError'>, NotImplementedError())
sys.stdout.writelines(FailingIterNext()):(<class 'NotImplementedError'>, NotImplementedError())