File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -48,27 +48,9 @@ fn orjson(py: Python, m: &PyModule) -> PyResult<()> {
4848
4949 m. add ( "JSONDecodeError" , py. get_type :: < exc:: JSONDecodeError > ( ) ) ?;
5050 m. add ( "JSONEncodeError" , py. get_type :: < exc:: JSONEncodeError > ( ) ) ?;
51+ m. add ( "OPT_STRICT_INTEGER" , encode:: STRICT_INTEGER ) ?;
52+ m. add ( "OPT_NAIVE_UTC" , encode:: NAIVE_UTC ) ?;
5153
52- unsafe {
53- pyo3:: ffi:: PyModule_AddObject (
54- m. as_ptr ( ) ,
55- "OPT_STRICT_INTEGER\0 " . as_ptr ( ) as * const c_char ,
56- #[ cfg( target_os = "windows" ) ]
57- pyo3:: ffi:: PyLong_FromUnsignedLongLong ( encode:: STRICT_INTEGER as u64 ) ,
58- #[ cfg( not( target_os = "windows" ) ) ]
59- pyo3:: ffi:: PyLong_FromUnsignedLong ( encode:: STRICT_INTEGER as u64 ) ,
60- )
61- } ;
62- unsafe {
63- pyo3:: ffi:: PyModule_AddObject (
64- m. as_ptr ( ) ,
65- "OPT_NAIVE_UTC\0 " . as_ptr ( ) as * const c_char ,
66- #[ cfg( target_os = "windows" ) ]
67- pyo3:: ffi:: PyLong_FromUnsignedLongLong ( encode:: NAIVE_UTC as u64 ) ,
68- #[ cfg( not( target_os = "windows" ) ) ]
69- pyo3:: ffi:: PyLong_FromUnsignedLong ( encode:: NAIVE_UTC as u64 ) ,
70- )
71- } ;
7254 Ok ( ( ) )
7355}
7456
You can’t perform that action at this time.
0 commit comments