@@ -164,7 +164,7 @@ static union Sass_Value* _list_to_sass_value(PyObject* value) {
164
164
retv = sass_make_list (PyTuple_Size (items ), sep , is_bracketed );
165
165
for (i = 0 ; i < PyTuple_Size (items ); i += 1 ) {
166
166
sass_list_set_value (
167
- retv , i , _to_sass_value (PyTuple_GET_ITEM (items , i ))
167
+ retv , i , _to_sass_value (PyTuple_GetItem (items , i ))
168
168
);
169
169
}
170
170
Py_DECREF (types_mod );
@@ -200,7 +200,7 @@ static union Sass_Value* _number_to_sass_value(PyObject* value) {
200
200
PyObject * unit = PyObject_GetAttrString (value , "unit" );
201
201
PyObject * bytes = PyUnicode_AsEncodedString (unit , "UTF-8" , "strict" );
202
202
retv = sass_make_number (
203
- PyFloat_AsDouble (d_value ), PyBytes_AS_STRING (bytes )
203
+ PyFloat_AsDouble (d_value ), PyBytes_AsString (bytes )
204
204
);
205
205
Py_DECREF (d_value );
206
206
Py_DECREF (unit );
@@ -211,7 +211,7 @@ static union Sass_Value* _number_to_sass_value(PyObject* value) {
211
211
static union Sass_Value * _unicode_to_sass_value (PyObject * value ) {
212
212
union Sass_Value * retv = NULL ;
213
213
PyObject * bytes = PyUnicode_AsEncodedString (value , "UTF-8" , "strict" );
214
- retv = sass_make_string (PyBytes_AS_STRING (bytes ));
214
+ retv = sass_make_string (PyBytes_AsString (bytes ));
215
215
Py_DECREF (bytes );
216
216
return retv ;
217
217
}
@@ -220,7 +220,7 @@ static union Sass_Value* _warning_to_sass_value(PyObject* value) {
220
220
union Sass_Value * retv = NULL ;
221
221
PyObject * msg = PyObject_GetAttrString (value , "msg" );
222
222
PyObject * bytes = PyUnicode_AsEncodedString (msg , "UTF-8" , "strict" );
223
- retv = sass_make_warning (PyBytes_AS_STRING (bytes ));
223
+ retv = sass_make_warning (PyBytes_AsString (bytes ));
224
224
Py_DECREF (msg );
225
225
Py_DECREF (bytes );
226
226
return retv ;
@@ -230,7 +230,7 @@ static union Sass_Value* _error_to_sass_value(PyObject* value) {
230
230
union Sass_Value * retv = NULL ;
231
231
PyObject * msg = PyObject_GetAttrString (value , "msg" );
232
232
PyObject * bytes = PyUnicode_AsEncodedString (msg , "UTF-8" , "strict" );
233
- retv = sass_make_error (PyBytes_AS_STRING (bytes ));
233
+ retv = sass_make_error (PyBytes_AsString (bytes ));
234
234
Py_DECREF (msg );
235
235
Py_DECREF (bytes );
236
236
return retv ;
@@ -259,7 +259,7 @@ static union Sass_Value* _unknown_type_to_sass_error(PyObject* value) {
259
259
format_meth , type_name , NULL
260
260
);
261
261
PyObject * bytes = PyUnicode_AsEncodedString (result , "UTF-8" , "strict" );
262
- retv = sass_make_error (PyBytes_AS_STRING (bytes ));
262
+ retv = sass_make_error (PyBytes_AsString (bytes ));
263
263
Py_DECREF (type );
264
264
Py_DECREF (type_name );
265
265
Py_DECREF (fmt );
@@ -298,7 +298,7 @@ static PyObject* _exception_to_bytes() {
298
298
299
299
static union Sass_Value * _exception_to_sass_error () {
300
300
PyObject * bytes = _exception_to_bytes ();
301
- union Sass_Value * retv = sass_make_error (PyBytes_AS_STRING (bytes ));
301
+ union Sass_Value * retv = sass_make_error (PyBytes_AsString (bytes ));
302
302
Py_DECREF (bytes );
303
303
return retv ;
304
304
}
@@ -307,7 +307,7 @@ static Sass_Import_List _exception_to_sass_import_error(const char* path) {
307
307
PyObject * bytes = _exception_to_bytes ();
308
308
Sass_Import_List import_list = sass_make_import_list (1 );
309
309
import_list [0 ] = sass_make_import_entry (path , 0 , 0 );
310
- sass_import_set_error (import_list [0 ], PyBytes_AS_STRING (bytes ), 0 , 0 );
310
+ sass_import_set_error (import_list [0 ], PyBytes_AsString (bytes ), 0 , 0 );
311
311
Py_DECREF (bytes );
312
312
return import_list ;
313
313
}
@@ -330,7 +330,7 @@ static union Sass_Value* _to_sass_value(PyObject* value) {
330
330
} else if (PyUnicode_Check (value )) {
331
331
retv = _unicode_to_sass_value (value );
332
332
} else if (PyBytes_Check (value )) {
333
- retv = sass_make_string (PyBytes_AS_STRING (value ));
333
+ retv = sass_make_string (PyBytes_AsString (value ));
334
334
/* XXX: PyMapping_Check returns true for lists and tuples in python3 :( */
335
335
/* XXX: pypy derps on dicts: https://bitbucket.org/pypy/pypy/issue/1970 */
336
336
} else if (PyDict_Check (value ) || PyObject_IsInstance (value , mapping_t )) {
@@ -400,11 +400,11 @@ static void _add_custom_functions(
400
400
Sass_Function_List fn_list = sass_make_function_list (
401
401
PyList_Size (custom_functions )
402
402
);
403
- for (i = 0 ; i < PyList_GET_SIZE (custom_functions ); i += 1 ) {
404
- PyObject * sass_function = PyList_GET_ITEM (custom_functions , i );
403
+ for (i = 0 ; i < PyList_Size (custom_functions ); i += 1 ) {
404
+ PyObject * sass_function = PyList_GetItem (custom_functions , i );
405
405
PyObject * signature = PySass_Object_Bytes (sass_function );
406
406
Sass_Function_Entry fn = sass_make_function (
407
- PyBytes_AS_STRING (signature ),
407
+ PyBytes_AsString (signature ),
408
408
_call_py_f ,
409
409
sass_function
410
410
);
@@ -439,13 +439,13 @@ static Sass_Import_List _call_py_importer_f(
439
439
440
440
/* Otherwise, we know our importer is well formed (because we wrap it)
441
441
* The return value will be a tuple of 1, 2, or 3 tuples */
442
- sass_imports = sass_make_import_list (PyTuple_GET_SIZE (py_result ));
443
- for (i = 0 ; i < PyTuple_GET_SIZE (py_result ); i += 1 ) {
442
+ sass_imports = sass_make_import_list (PyTuple_Size (py_result ));
443
+ for (i = 0 ; i < PyTuple_Size (py_result ); i += 1 ) {
444
444
char * path_str = NULL ; /* XXX: Memory leak? */
445
445
char * source_str = NULL ;
446
446
char * sourcemap_str = NULL ;
447
- PyObject * tup = PyTuple_GET_ITEM (py_result , i );
448
- Py_ssize_t size = PyTuple_GET_SIZE (tup );
447
+ PyObject * tup = PyTuple_GetItem (py_result , i );
448
+ Py_ssize_t size = PyTuple_Size (tup );
449
449
450
450
if (size == 1 ) {
451
451
PyArg_ParseTuple (tup , PySass_IF_PY3 ("y" , "s" ), & path_str );
@@ -491,10 +491,10 @@ static void _add_custom_importers(
491
491
return ;
492
492
}
493
493
494
- importer_list = sass_make_importer_list (PyTuple_GET_SIZE (custom_importers ));
494
+ importer_list = sass_make_importer_list (PyTuple_Size (custom_importers ));
495
495
496
- for (i = 0 ; i < PyTuple_GET_SIZE (custom_importers ); i += 1 ) {
497
- PyObject * item = PyTuple_GET_ITEM (custom_importers , i );
496
+ for (i = 0 ; i < PyTuple_Size (custom_importers ); i += 1 ) {
497
+ PyObject * item = PyTuple_GetItem (custom_importers , i );
498
498
int priority = 0 ;
499
499
PyObject * import_function = NULL ;
500
500
@@ -513,11 +513,11 @@ PySass_compile_string(PyObject *self, PyObject *args) {
513
513
struct Sass_Context * ctx ;
514
514
struct Sass_Data_Context * context ;
515
515
struct Sass_Options * options ;
516
- char * string , * include_paths , * source_map_file ;
516
+ char * string , * include_paths ;
517
517
const char * error_message , * output_string ;
518
518
enum Sass_Output_Style output_style ;
519
519
int source_comments , error_status , precision , indented ,
520
- source_map_embed , source_map_contents , source_map_file_urls ,
520
+ source_map_embed , source_map_contents ,
521
521
omit_source_map_url ;
522
522
PyObject * custom_functions ;
523
523
PyObject * custom_importers ;
@@ -545,9 +545,9 @@ PySass_compile_string(PyObject *self, PyObject *args) {
545
545
sass_option_set_source_map_embed (options , source_map_embed );
546
546
sass_option_set_omit_source_map_url (options , omit_source_map_url );
547
547
548
- if (PyBytes_Check (source_map_root ) && PyBytes_GET_SIZE (source_map_root )) {
548
+ if (PyBytes_Check (source_map_root ) && PyBytes_Size (source_map_root )) {
549
549
sass_option_set_source_map_root (
550
- options , PyBytes_AS_STRING (source_map_root )
550
+ options , PyBytes_AsString (source_map_root )
551
551
);
552
552
}
553
553
@@ -577,7 +577,7 @@ PySass_compile_filename(PyObject *self, PyObject *args) {
577
577
const char * error_message , * output_string , * source_map_string ;
578
578
enum Sass_Output_Style output_style ;
579
579
int source_comments , error_status , precision , source_map_embed ,
580
- source_map_contents , source_map_file_urls , omit_source_map_url ;
580
+ source_map_contents , omit_source_map_url ;
581
581
PyObject * source_map_filename , * custom_functions , * custom_importers ,
582
582
* result , * output_filename_hint , * source_map_root ;
583
583
@@ -596,23 +596,23 @@ PySass_compile_filename(PyObject *self, PyObject *args) {
596
596
options = sass_file_context_get_options (context );
597
597
598
598
if (PyBytes_Check (source_map_filename )) {
599
- if (PyBytes_GET_SIZE (source_map_filename )) {
599
+ if (PyBytes_Size (source_map_filename )) {
600
600
sass_option_set_source_map_file (
601
- options , PyBytes_AS_STRING (source_map_filename )
601
+ options , PyBytes_AsString (source_map_filename )
602
602
);
603
603
}
604
604
}
605
605
if (PyBytes_Check (output_filename_hint )) {
606
- if (PyBytes_GET_SIZE (output_filename_hint )) {
606
+ if (PyBytes_Size (output_filename_hint )) {
607
607
sass_option_set_output_path (
608
- options , PyBytes_AS_STRING (output_filename_hint )
608
+ options , PyBytes_AsString (output_filename_hint )
609
609
);
610
610
}
611
611
}
612
612
613
- if (PyBytes_Check (source_map_root ) && PyBytes_GET_SIZE (source_map_root )) {
613
+ if (PyBytes_Check (source_map_root ) && PyBytes_Size (source_map_root )) {
614
614
sass_option_set_source_map_root (
615
- options , PyBytes_AS_STRING (source_map_root )
615
+ options , PyBytes_AsString (source_map_root )
616
616
);
617
617
}
618
618
0 commit comments