Fixes the Note: mentioned before.
# HG changeset patch
# User ZyX <[email protected]>
# Date 1371701162 -14400
# Thu Jun 20 08:06:02 2013 +0400
# Branch python-fixes
# Node ID 32abf0ae95195d73a017a8d53af65e9deea20856
# Parent 38acdea8fd7d2179916c4e67bdc8e54941929093
Let non-ImportError exceptions pass the finder
diff -r 38acdea8fd7d -r 32abf0ae9519 src/if_py_both.h
--- a/src/if_py_both.h Wed Jun 19 23:10:21 2013 +0400
+++ b/src/if_py_both.h Thu Jun 20 08:06:02 2013 +0400
@@ -1199,6 +1199,14 @@
if (!module)
{
+ if (PyErr_Occurred())
+ {
+ if (PyErr_ExceptionMatches(PyExc_ImportError))
+ PyErr_Clear();
+ else
+ return NULL;
+ }
+
Py_INCREF(Py_None);
return Py_None;
}
diff -r 38acdea8fd7d -r 32abf0ae9519 src/testdir/test86.ok
--- a/src/testdir/test86.ok Wed Jun 19 23:10:21 2013 +0400
+++ b/src/testdir/test86.ok Thu Jun 20 08:06:02 2013 +0400
@@ -497,7 +497,7 @@
> import
import xxx_no_such_module_xxx:ImportError:('No module named
xxx_no_such_module_xxx',)
import failing_import:ImportError:('No module named failing_import',)
-import failing:ImportError:('No module named failing',)
+import failing:NotImplementedError:()
> Dictionary
>> DictionaryConstructor
vim.Dictionary("abcI"):ValueError:('expected sequence element of size 2, but
got sequence of size 1',)
diff -r 38acdea8fd7d -r 32abf0ae9519 src/testdir/test87.ok
--- a/src/testdir/test87.ok Wed Jun 19 23:10:21 2013 +0400
+++ b/src/testdir/test87.ok Thu Jun 20 08:06:02 2013 +0400
@@ -486,7 +486,7 @@
> import
import xxx_no_such_module_xxx:(<class 'ImportError'>, ImportError('No module
named xxx_no_such_module_xxx',))
import failing_import:(<class 'ImportError'>, ImportError('No module named
failing_import',))
-import failing:(<class 'ImportError'>, ImportError('No module named failing',))
+import failing:(<class 'NotImplementedError'>, NotImplementedError())
> Dictionary
>> DictionaryConstructor
vim.Dictionary("abcI"):(<class 'ValueError'>, ValueError('expected sequence
element of size 2, but got sequence of size 1',))
--
--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
---
You received this message because you are subscribed to the Google Groups
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.
diff -crN vim.38acdea8fd7d/src/if_py_both.h vim.32abf0ae9519/src/if_py_both.h
*** vim.38acdea8fd7d/src/if_py_both.h 2013-06-20 08:06:16.022394445 +0400
--- vim.32abf0ae9519/src/if_py_both.h 2013-06-20 08:06:16.028394385 +0400
***************
*** 1199,1204 ****
--- 1199,1212 ----
if (!module)
{
+ if (PyErr_Occurred())
+ {
+ if (PyErr_ExceptionMatches(PyExc_ImportError))
+ PyErr_Clear();
+ else
+ return NULL;
+ }
+
Py_INCREF(Py_None);
return Py_None;
}
diff -crN vim.38acdea8fd7d/src/testdir/test86.ok vim.32abf0ae9519/src/testdir/test86.ok
*** vim.38acdea8fd7d/src/testdir/test86.ok 2013-06-20 08:06:16.019394476 +0400
--- vim.32abf0ae9519/src/testdir/test86.ok 2013-06-20 08:06:16.025394416 +0400
***************
*** 497,503 ****
> import
import xxx_no_such_module_xxx:ImportError:('No module named xxx_no_such_module_xxx',)
import failing_import:ImportError:('No module named failing_import',)
! import failing:ImportError:('No module named failing',)
> Dictionary
>> DictionaryConstructor
vim.Dictionary("abcI"):ValueError:('expected sequence element of size 2, but got sequence of size 1',)
--- 497,503 ----
> import
import xxx_no_such_module_xxx:ImportError:('No module named xxx_no_such_module_xxx',)
import failing_import:ImportError:('No module named failing_import',)
! import failing:NotImplementedError:()
> Dictionary
>> DictionaryConstructor
vim.Dictionary("abcI"):ValueError:('expected sequence element of size 2, but got sequence of size 1',)
diff -crN vim.38acdea8fd7d/src/testdir/test87.ok vim.32abf0ae9519/src/testdir/test87.ok
*** vim.38acdea8fd7d/src/testdir/test87.ok 2013-06-20 08:06:16.021394455 +0400
--- vim.32abf0ae9519/src/testdir/test87.ok 2013-06-20 08:06:16.027394396 +0400
***************
*** 486,492 ****
> import
import xxx_no_such_module_xxx:(<class 'ImportError'>, ImportError('No module named xxx_no_such_module_xxx',))
import failing_import:(<class 'ImportError'>, ImportError('No module named failing_import',))
! import failing:(<class 'ImportError'>, ImportError('No module named failing',))
> Dictionary
>> DictionaryConstructor
vim.Dictionary("abcI"):(<class 'ValueError'>, ValueError('expected sequence element of size 2, but got sequence of size 1',))
--- 486,492 ----
> import
import xxx_no_such_module_xxx:(<class 'ImportError'>, ImportError('No module named xxx_no_such_module_xxx',))
import failing_import:(<class 'ImportError'>, ImportError('No module named failing_import',))
! import failing:(<class 'NotImplementedError'>, NotImplementedError())
> Dictionary
>> DictionaryConstructor
vim.Dictionary("abcI"):(<class 'ValueError'>, ValueError('expected sequence element of size 2, but got sequence of size 1',))