summaryrefslogtreecommitdiff
path: root/src/if_py_both.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/if_py_both.h')
-rw-r--r--src/if_py_both.h16
1 files changed, 5 insertions, 11 deletions
diff --git a/src/if_py_both.h b/src/if_py_both.h
index e31509cf..5fe04760 100644
--- a/src/if_py_both.h
+++ b/src/if_py_both.h
@@ -2015,19 +2015,13 @@ FunctionNew(PyTypeObject *subtype, char_u *name)
func_ref(self->name);
}
else
- {
- self->name = get_expanded_name(name, TRUE);
- if (self->name == NULL)
+ if ((self->name = get_expanded_name(name,
+ vim_strchr(name, AUTOLOAD_CHAR) == NULL))
+ == NULL)
{
- if (script_autoload(name, TRUE) && !aborting())
- self->name = get_expanded_name(name, TRUE);
- if (self->name == NULL)
- {
- PyErr_SetString(PyExc_ValueError, _("function does not exist"));
- return NULL;
- }
+ PyErr_SetString(PyExc_ValueError, _("function does not exist"));
+ return NULL;
}
- }
return (PyObject *)(self);
}