Skip to content
This repository was archived by the owner on Jan 1, 2021. It is now read-only.

Commit 663ca62

Browse files
authored
Update __init__.py
1 parent 9ca0c86 commit 663ca62

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

coffeescript/__init__.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,10 @@
22
# -*- coding: ascii -*-
33
from __future__ import division, unicode_literals, print_function
44

5-
import pkg_resources
5+
try:
6+
from importlib.resources import files
7+
except ImportError:
8+
from importlib_resources import files
69

710
# Copyright (c) 2011 Omoto Kenji
811
# Released under the MIT license. See `LICENSE` for details.
@@ -116,9 +119,7 @@ def get_compiler_script():
116119
'''returns a CoffeeScript compiler script in JavaScript.
117120
which is used in coffeescript.compile() and coffeescript.compile_file()
118121
'''
119-
return pkg_resources.resource_string(
120-
'coffeescript', 'coffeescript.js').decode('utf-8')
121-
122+
return files('coffeescript').joinpath('coffeescript.js').read_text(encoding='utf-8')
122123

123124
def get_runtime():
124125
'''returns an appropriate instance of execjs.Runtime

0 commit comments

Comments
 (0)