Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
nexedi
cython
Commits
666ee64c
Commit
666ee64c
authored
Sep 12, 2017
by
Stefan Behnel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Include error helper function only at need and do not inline it.
parent
899b1086
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
9 deletions
+6
-9
Cython/Compiler/Nodes.py
Cython/Compiler/Nodes.py
+4
-4
Cython/Utility/FunctionArguments.c
Cython/Utility/FunctionArguments.c
+2
-5
No files found.
Cython/Compiler/Nodes.py
View file @
666ee64c
...
@@ -3574,10 +3574,6 @@ class DefNodeWrapper(FuncDefNode):
...
@@ -3574,10 +3574,6 @@ class DefNodeWrapper(FuncDefNode):
min_positional_args
==
max_positional_args
min_positional_args
==
max_positional_args
has_kw_only_args
=
bool
(
kw_only_args
)
has_kw_only_args
=
bool
(
kw_only_args
)
if
self
.
num_required_kw_args
:
code
.
globalstate
.
use_utility_code
(
UtilityCode
.
load_cached
(
"RaiseKeywordRequired"
,
"FunctionArguments.c"
))
if
self
.
starstar_arg
or
self
.
star_arg
:
if
self
.
starstar_arg
or
self
.
star_arg
:
self
.
generate_stararg_init_code
(
max_positional_args
,
code
)
self
.
generate_stararg_init_code
(
max_positional_args
,
code
)
...
@@ -3630,6 +3626,8 @@ class DefNodeWrapper(FuncDefNode):
...
@@ -3630,6 +3626,8 @@ class DefNodeWrapper(FuncDefNode):
if
not
arg
.
default
:
if
not
arg
.
default
:
pystring_cname
=
code
.
intern_identifier
(
arg
.
name
)
pystring_cname
=
code
.
intern_identifier
(
arg
.
name
)
# required keyword-only argument missing
# required keyword-only argument missing
code
.
globalstate
.
use_utility_code
(
UtilityCode
.
load_cached
(
"RaiseKeywordRequired"
,
"FunctionArguments.c"
))
code
.
put
(
'__Pyx_RaiseKeywordRequired("%s", %s); '
%
(
code
.
put
(
'__Pyx_RaiseKeywordRequired("%s", %s); '
%
(
self
.
name
,
self
.
name
,
pystring_cname
))
pystring_cname
))
...
@@ -3851,6 +3849,8 @@ class DefNodeWrapper(FuncDefNode):
...
@@ -3851,6 +3849,8 @@ class DefNodeWrapper(FuncDefNode):
code
.
putln
(
'}'
)
code
.
putln
(
'}'
)
elif
arg
.
kw_only
:
elif
arg
.
kw_only
:
code
.
putln
(
'else {'
)
code
.
putln
(
'else {'
)
code
.
globalstate
.
use_utility_code
(
UtilityCode
.
load_cached
(
"RaiseKeywordRequired"
,
"FunctionArguments.c"
))
code
.
put
(
'__Pyx_RaiseKeywordRequired("%s", %s); '
%
(
code
.
put
(
'__Pyx_RaiseKeywordRequired("%s", %s); '
%
(
self
.
name
,
pystring_cname
))
self
.
name
,
pystring_cname
))
code
.
putln
(
code
.
error_goto
(
self
.
pos
))
code
.
putln
(
code
.
error_goto
(
self
.
pos
))
...
...
Cython/Utility/FunctionArguments.c
View file @
666ee64c
...
@@ -69,14 +69,11 @@ static void __Pyx_RaiseArgtupleInvalid(
...
@@ -69,14 +69,11 @@ static void __Pyx_RaiseArgtupleInvalid(
//////////////////// RaiseKeywordRequired.proto ////////////////////
//////////////////// RaiseKeywordRequired.proto ////////////////////
static
CYTHON_INLINE
void
__Pyx_RaiseKeywordRequired
(
const
char
*
func_name
,
PyObject
*
kw_name
);
/*proto*/
static
void
__Pyx_RaiseKeywordRequired
(
const
char
*
func_name
,
PyObject
*
kw_name
);
/*proto*/
//////////////////// RaiseKeywordRequired ////////////////////
//////////////////// RaiseKeywordRequired ////////////////////
static
CYTHON_INLINE
void
__Pyx_RaiseKeywordRequired
(
static
void
__Pyx_RaiseKeywordRequired
(
const
char
*
func_name
,
PyObject
*
kw_name
)
{
const
char
*
func_name
,
PyObject
*
kw_name
)
{
PyErr_Format
(
PyExc_TypeError
,
PyErr_Format
(
PyExc_TypeError
,
#if PY_MAJOR_VERSION >= 3
#if PY_MAJOR_VERSION >= 3
"%s() needs keyword-only argument %U"
,
func_name
,
kw_name
);
"%s() needs keyword-only argument %U"
,
func_name
,
kw_name
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment