Mercurial > vim
comparison src/testdir/test_python3.vim @ 23992:faca24acb37f v8.2.2538
patch 8.2.2538: crash when using Python list iterator
Commit: https://github.com/vim/vim/commit/21578271bb717f7ab7b8728e9efa54c3b60ee7e4
Author: Bram Moolenaar <Bram@vim.org>
Date: Sun Feb 21 19:12:47 2021 +0100
patch 8.2.2538: crash when using Python list iterator
Problem: Crash when using Python list iterator.
Solution: Increment the list reference count. (closes https://github.com/vim/vim/issues/7886)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sun, 21 Feb 2021 19:15:03 +0100 |
parents | f6514ca9f45e |
children | 8feb0450b690 |
comparison
equal
deleted
inserted
replaced
23991:88faa03cdc6f | 23992:faca24acb37f |
---|---|
571 " appending to a list | 571 " appending to a list |
572 let l = [1, 2] | 572 let l = [1, 2] |
573 py3 ll = vim.bindeval('l') | 573 py3 ll = vim.bindeval('l') |
574 py3 ll[2] = 8 | 574 py3 ll[2] = 8 |
575 call assert_equal([1, 2, 8], l) | 575 call assert_equal([1, 2, 8], l) |
576 | |
577 " iterating over list from Python | |
578 py3 print([x for x in vim.Function("getline")(1, 2)]) | |
576 | 579 |
577 " Using dict as an index | 580 " Using dict as an index |
578 call AssertException(['py3 ll[{}] = 10'], | 581 call AssertException(['py3 ll[{}] = 10'], |
579 \ 'Vim(py3):TypeError: index must be int or slice, not dict') | 582 \ 'Vim(py3):TypeError: index must be int or slice, not dict') |
580 endfunc | 583 endfunc |