Skip to content

Commit 0c4b858

Browse files
IwanKaramazowIwan
and
Iwan
authored
Remove pathlib dependency. (#1)
`pathlib` is not available in python 2.7; `format.py` will crash in that situation. The easiest solution is to just remove the dependency on `pathlib` and use `os.path.splitext` which seems to be supported by both python 2 and python 3 Co-authored-by: Iwan <[email protected]>
1 parent ce2c72b commit 0c4b858

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

format.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
import re
55
import os
66
import tempfile
7-
import pathlib
87
import platform
98

109
SETTINGS_PATH = 'Default.sublime-settings'
@@ -187,7 +186,7 @@ def run(self, edit, formatBuffer=True):
187186
if bscExe == None:
188187
return
189188

190-
extension = pathlib.Path(filename).suffix
189+
_, extension = os.path.splitext(filename)
191190
formattedResult = formatUsingValidBscPath(
192191
code,
193192
bscExe,

0 commit comments

Comments
 (0)