| Index: utils.py |
| =================================================================== |
| --- a/utils.py |
| +++ b/utils.py |
| @@ -31,14 +31,12 @@ |
| } |
| -def ensureJSShell(): |
| +def ensure_jsshell(): |
| path = os.environ.get('SPIDERMONKEY_BINARY') |
| if path and os.path.isfile(path): |
| return path |
| - baseDir = os.path.dirname(__file__) |
| system = platform.system() |
| - |
| try: |
| build = JSSHELL_SUPPORTED_PLATFORMS[system] |
| if isinstance(build, dict): |
| @@ -48,7 +46,8 @@ |
| system, platform.machine() |
| )) |
| - shell_dir = os.path.join(baseDir, JSSHELL_DIR + "-" + build) |
| + shell_dir = os.path.join(os.path.dirname(__file__), |
| + '{}-{}'.format(JSSHELL_DIR, build)) |
| if not os.path.exists(shell_dir): |
| os.makedirs(shell_dir) |
| if system == 'Windows': |
| @@ -66,7 +65,7 @@ |
| archive.extractall(shell_dir) |
| if not os.path.exists(path): |
| - raise Exception('Downloaded package didn\'t contain JS shell executable') |
| + raise Exception("Downloaded package doesn't contain JS shell") |
| try: |
| os.chmod(path, 0o700) |