Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions requirejs/filter.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def __init__(self, content, attrs=None, filter_type=None, charset=None, filename

# noinspection PyMethodMayBeStatic
def get_module_finder(self, main=None):
template_directories = settings.TEMPLATE_DIRS + get_app_template_dirs()
template_directories = settings.TEMPLATES[0]['DIRS'] + get_app_template_dirs()
shim_dependencies = list(chain(*[s.get('deps', []) for s in CONFIG.get('shim', {}).values()]))
main_dependency = [main] if main else []
dependencies = shim_dependencies + main_dependency
Expand Down Expand Up @@ -80,7 +80,7 @@ def get_bundle_content(module, original_content):

Returns the rewritten content of the module and None if no define-call was found.
"""
text_content = text_type(original_content, settings.FILE_CHARSET)
text_content = text_type(original_content)
define_call = define_replace_pattern.findall(text_content)
if define_call:
if not module.named:
Expand Down
2 changes: 1 addition & 1 deletion requirejs/finder.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ def get_module_name(name):

@staticmethod
def get_module_content(path):
with open(path, 'r') as f:
with open(path, 'r', encoding='utf8') as f:
return f.read()

@staticmethod
Expand Down