@@ -55,14 +55,6 @@ class zstd_contentsize_converter(CConverter):
5555[python start generated code]*/
5656/*[python end generated code: output=da39a3ee5e6b4b0d input=0932c350d633c7de]*/
5757
58- static inline int
59- raise_wrong_contentsize (void )
60- {
61- PyErr_Format (PyExc_ValueError ,
62- "size argument should be a positive int less "
63- "than %ull" , ZSTD_CONTENTSIZE_ERROR );
64- return 0 ;
65- }
6658
6759static int
6860zstd_contentsize_converter (PyObject * size , unsigned long long * p )
@@ -81,13 +73,19 @@ zstd_contentsize_converter(PyObject *size, unsigned long long *p)
8173 if (pledged_size == (unsigned long long )-1 && PyErr_Occurred ()) {
8274 * p = ZSTD_CONTENTSIZE_ERROR ;
8375 if (PyErr_ExceptionMatches (PyExc_OverflowError )) {
84- return raise_wrong_contentsize ();
76+ PyErr_Format (PyExc_ValueError ,
77+ "size argument should be a positive int less "
78+ "than %ull" , ZSTD_CONTENTSIZE_ERROR );
79+ return 0 ;
8580 }
8681 return 0 ;
8782 }
8883 if (pledged_size >= ZSTD_CONTENTSIZE_ERROR ) {
8984 * p = ZSTD_CONTENTSIZE_ERROR ;
90- return raise_wrong_contentsize ();
85+ PyErr_Format (PyExc_ValueError ,
86+ "size argument should be a positive int less "
87+ "than %ull" , ZSTD_CONTENTSIZE_ERROR );
88+ return 0 ;
9189 }
9290 * p = pledged_size ;
9391 }
0 commit comments