]> gitweb.factorcode.org Git - factor.git/commitdiff
python: fix some more tests
authorJohn Benediktsson <mrjbq7@gmail.com>
Wed, 19 Jan 2022 04:03:37 +0000 (20:03 -0800)
committerJohn Benediktsson <mrjbq7@gmail.com>
Wed, 19 Jan 2022 04:03:37 +0000 (20:03 -0800)
extra/python/ffi/ffi.factor
extra/python/python.factor
extra/python/syntax/syntax-tests.factor

index a6a118d4e69e2d422f1a19786747bedcd4ae3d02..37be4fffe6dc0022a0f90109e2e2f303c6615567 100644 (file)
@@ -139,6 +139,7 @@ FUNCTION: PyObject* PyBytes_FromStringAndSize ( c-string v, Py_ssize_t size  )
 ! Strings
 FUNCTION: c-string PyUnicode_AsUTF8 ( PyObject* unicode )
 FUNCTION: PyObject* PyUnicode_FromStringAndSize ( c-string v, Py_ssize_t size  )
+FUNCTION: PyObject* PyUnicode_FromString ( c-string v )
 
 ! Ints
 FUNCTION: long PyLong_AsLong ( PyObject* io )
index 7445c6c931e5d39704fbec1c9e9701104ccf3f2c..cb54f180611120390436251fde17e6e691c38a1e 100644 (file)
@@ -40,7 +40,7 @@ DEFER: py>
     dup py-list-size <iota> [ py-list-get-item py> ] with V{ } map-as ;
 
 : py-unicode>string ( py-unicode -- str )
-    PyUnicode_AsUTF8 (check-ref) utf8 decode ;
+    PyUnicode_AsUTF8 (check-ref) ;
 
 : py-bytes>byte-array ( py-bytes -- byte-array )
     PyBytes_AsString (check-ref) >byte-array ;
@@ -54,7 +54,7 @@ M: byte-array >py
     dup length PyBytes_FromStringAndSize check-new-ref ;
 
 M: string >py
-    utf8 encode dup length PyUnicode_FromStringAndSize check-new-ref ;
+    PyUnicode_FromString check-new-ref ;
 
 M: math:fixnum >py
     PyLong_FromLong check-new-ref ;
index 26340e60287a5054be5b633f832ecc1deaf982cb..4f097c2b1ac12820817ce781e138a042685a6c4b 100644 (file)
@@ -106,7 +106,7 @@ PY-METHODS: code =>
     [
         ArgumentParser dup
         "--foo" >py H{ { "help" "badger" } } >py add_argument
-        format_help py>
+        format_help
     ] with-destructors [ blank? ] s:trim split-words "badger" swap in?
 ] py-test