diff options
author | Matti Picus <matti.picus@gmail.com> | 2021-01-04 08:43:41 +0200 |
---|---|---|
committer | Matti Picus <matti.picus@gmail.com> | 2021-01-04 08:43:41 +0200 |
commit | 893b9e392a800a42f92d97d35dd7e6cdda1fd086 (patch) | |
tree | c649b44c1ffcb9900191f6a715f14be2ba8b4e5d /rpython | |
parent | test, fix parsing "inf" and friends in PyOS_string_to_double (issue 3375) (diff) | |
download | pypy-893b9e392a800a42f92d97d35dd7e6cdda1fd086.tar.gz pypy-893b9e392a800a42f92d97d35dd7e6cdda1fd086.tar.bz2 pypy-893b9e392a800a42f92d97d35dd7e6cdda1fd086.zip |
add str2constcharp for tests
Diffstat (limited to 'rpython')
-rw-r--r-- | rpython/rtyper/lltypesystem/rffi.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/rpython/rtyper/lltypesystem/rffi.py b/rpython/rtyper/lltypesystem/rffi.py index 59d977c3ee..8196f19dff 100644 --- a/rpython/rtyper/lltypesystem/rffi.py +++ b/rpython/rtyper/lltypesystem/rffi.py @@ -1049,6 +1049,13 @@ def constcharpsize2str(cp, size): return charpsize2str(cp, size) constcharpsize2str._annenforceargs_ = [lltype.SomePtr(CONST_CCHARP), int] +def str2constcharp(s): + """ + Like str2charp, but returns a CONST_CCHARP instead + """ + cp = str2charp(s) + return cast(CONST_CCHARP, cp) +str2constcharp._annenforceargs_ = [str] @not_rpython def _deprecated_get_nonmovingbuffer(*args): |