@@ -225,7 +225,7 @@ def _raise(e):
225225
226226def compile_dirname (
227227 search_path , output_path , output_style , source_comments , include_paths ,
228- precision , custom_functions , importers , custom_import_extensions ,
228+ precision , custom_functions , importers ,
229229):
230230 fs_encoding = sys .getfilesystemencoding () or sys .getdefaultencoding ()
231231 for dirpath , _ , filenames in os .walk (search_path , onerror = _raise ):
@@ -243,7 +243,6 @@ def compile_dirname(
243243 s , v , _ = _sass .compile_filename (
244244 input_filename , output_style , source_comments , include_paths ,
245245 precision , None , custom_functions , importers , None ,
246- custom_import_extensions ,
247246 )
248247 if s :
249248 v = v .decode ('UTF-8' )
@@ -296,9 +295,7 @@ def compile(**kwargs):
296295 :type custom_functions: :class:`set`,
297296 :class:`collections.abc.Sequence`,
298297 :class:`collections.abc.Mapping`
299- :param custom_import_extensions: optional extra file extensions which
300- allow can be imported, eg. ``['.css']``
301- :type custom_import_extensions: :class:`list`, :class:`tuple`
298+ :param custom_import_extensions: (ignored, for backward compatibility)
302299 :param indented: optional declaration that the string is Sass, not SCSS
303300 formatted. :const:`False` by default
304301 :type indented: :class:`bool`
@@ -339,9 +336,7 @@ def compile(**kwargs):
339336 :type custom_functions: :class:`set`,
340337 :class:`collections.abc.Sequence`,
341338 :class:`collections.abc.Mapping`
342- :param custom_import_extensions: optional extra file extensions which
343- allow can be imported, eg. ``['.css']``
344- :type custom_import_extensions: :class:`list`, :class:`tuple`
339+ :param custom_import_extensions: (ignored, for backward compatibility)
345340 :param importers: optional callback functions.
346341 see also below `importer callbacks
347342 <importer-callbacks_>`_ description
@@ -384,9 +379,7 @@ def compile(**kwargs):
384379 :type custom_functions: :class:`set`,
385380 :class:`collections.abc.Sequence`,
386381 :class:`collections.abc.Mapping`
387- :param custom_import_extensions: optional extra file extensions which
388- allow can be imported, eg. ``['.css']``
389- :type custom_import_extensions: :class:`list`, :class:`tuple`
382+ :param custom_import_extensions: (ignored, for backward compatibility)
390383 :raises sass.CompileError: when it fails for any reason
391384 (for example the given Sass has broken syntax)
392385
@@ -606,13 +599,12 @@ def _get_file_arg(key):
606599 'not {1!r}' .format (SassFunction , custom_functions ),
607600 )
608601
609- _custom_exts = kwargs .pop ('custom_import_extensions' , []) or []
610- if not isinstance ( _custom_exts , ( list , tuple )):
611- raise TypeError (
612- 'custom_import_extensions must be a list of strings '
613- 'not {}' . format ( type ( _custom_exts )) ,
602+ if kwargs .pop ('custom_import_extensions' , None ) is not None :
603+ warnings . warn (
604+ '`custom_import_extensions` has no effect and will be removed in '
605+ 'a future version.' ,
606+ FutureWarning ,
614607 )
615- custom_import_extensions = [ext .encode ('utf-8' ) for ext in _custom_exts ]
616608
617609 importers = _validate_importers (kwargs .pop ('importers' , None ))
618610
@@ -627,7 +619,7 @@ def _get_file_arg(key):
627619 _check_no_remaining_kwargs (compile , kwargs )
628620 s , v = _sass .compile_string (
629621 string , output_style , source_comments , include_paths , precision ,
630- custom_functions , indented , importers , custom_import_extensions ,
622+ custom_functions , indented , importers ,
631623 )
632624 if s :
633625 return v .decode ('utf-8' )
@@ -643,7 +635,7 @@ def _get_file_arg(key):
643635 s , v , source_map = _sass .compile_filename (
644636 filename , output_style , source_comments , include_paths , precision ,
645637 source_map_filename , custom_functions , importers ,
646- output_filename_hint , custom_import_extensions ,
638+ output_filename_hint ,
647639 )
648640 if s :
649641 v = v .decode ('utf-8' )
@@ -663,7 +655,6 @@ def _get_file_arg(key):
663655 s , v = compile_dirname (
664656 search_path , output_path , output_style , source_comments ,
665657 include_paths , precision , custom_functions , importers ,
666- custom_import_extensions ,
667658 )
668659 if s :
669660 return
0 commit comments