Skip to content

Commit df0f100

Browse files
committed
Replace __file__ with __spec__.origin #137
1 parent edadce3 commit df0f100

File tree

3 files changed

+6
-2
lines changed

3 files changed

+6
-2
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
### 4.5.2 - Aug 4, 2025
2+
3+
- Prepare for python 3.13 #137
4+
15
### 4.5.0 - Jun 29, 2025
26

37
- Improved stacktrace formatting, closer match for clojure+

cs_common.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,7 @@ def on_pre_close_window(self, window):
280280

281281
def plugin_loaded():
282282
global package
283-
package_path = os.path.dirname(os.path.abspath(__file__))
283+
package_path = os.path.dirname(os.path.abspath(__spec__.origin))
284284
if os.path.isfile(package_path):
285285
# Package is a .sublime-package so get its filename
286286
package, _ = os.path.splitext(os.path.basename(package_path))

cs_parser.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -392,7 +392,7 @@ def search(node, pos, pred = None, max_depth = 1000):
392392
elif pos < child.start:
393393
break
394394

395-
if __package__:
395+
if __spec__.parent:
396396
import sublime, sublime_plugin
397397

398398
def parse_tree(view, region = None):

0 commit comments

Comments
 (0)