@@ -105,13 +105,11 @@ cdef const uint8_t[:] rle_decompress(int result_length,
105
105
result[rpos] = 0x00
106
106
rpos += 1
107
107
else :
108
- raise ValueError (" unknown control byte: {byte}"
109
- .format(byte = control_byte))
108
+ raise ValueError (f" unknown control byte: {control_byte}" )
110
109
111
110
# In py37 cython/clang sees `len(outbuff)` as size_t and not Py_ssize_t
112
111
if < Py_ssize_t> len (result) != < Py_ssize_t> result_length:
113
- raise ValueError (" RLE: {got} != {expect}" .format(got = len (result),
114
- expect = result_length))
112
+ raise ValueError (f" RLE: {len(result)} != {result_length}" )
115
113
116
114
return np.asarray(result)
117
115
@@ -194,8 +192,7 @@ cdef const uint8_t[:] rdc_decompress(int result_length,
194
192
195
193
# In py37 cython/clang sees `len(outbuff)` as size_t and not Py_ssize_t
196
194
if < Py_ssize_t> len (outbuff) != < Py_ssize_t> result_length:
197
- raise ValueError (" RDC: {got} != {expect}\n "
198
- .format(got = len (outbuff), expect = result_length))
195
+ raise ValueError (f" RDC: {len(outbuff)} != {result_length}\n " )
199
196
200
197
return np.asarray(outbuff)
201
198
@@ -271,8 +268,7 @@ cdef class Parser:
271
268
self .column_types[j] = column_type_string
272
269
else :
273
270
raise ValueError (" unknown column type: "
274
- " {typ}"
275
- .format(typ = self .parser.columns[j].ctype))
271
+ f" {self.parser.columns[j].ctype}" )
276
272
277
273
# compression
278
274
if parser.compression == const.rle_compression:
@@ -392,8 +388,7 @@ cdef class Parser:
392
388
return True
393
389
return False
394
390
else :
395
- raise ValueError (" unknown page type: {typ}"
396
- .format(typ = self .current_page_type))
391
+ raise ValueError (f" unknown page type: {self.current_page_type}" )
397
392
398
393
cdef void process_byte_array_with_data(self , int offset, int length):
399
394
0 commit comments