mirror of
https://github.com/avatao-content/baseimage-tutorial-framework
synced 2024-11-22 17:41:32 +00:00
Refactor trivial piece of code overcomplicated
This commit is contained in:
parent
557318af4e
commit
be244217aa
@ -96,7 +96,4 @@ def map_file_extension_to_language(filename):
|
|||||||
'.cs': 'csharp'
|
'.cs': 'csharp'
|
||||||
}
|
}
|
||||||
_, extension = splitext(filename)
|
_, extension = splitext(filename)
|
||||||
language = 'text'
|
return language_map.get(extension, 'text')
|
||||||
try: language = language_map[extension]
|
|
||||||
except KeyError: log.debug('No such extension in list, falling back to default: "{}".'.format(language))
|
|
||||||
return language
|
|
Loading…
Reference in New Issue
Block a user