Skip to content

Commit 76ddb06

Browse files
committed
Ensure __path__
This commit explicitly sets `__name__` and `__package__` in plugin.py as those are heavily used despite probably no longer being initialized on python 3.13, if Package Control is loaded from .sublime-package.
1 parent 2440e1c commit 76ddb06

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

plugin.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@
22
import sublime
33
import sys
44

5+
# Ensure compatibility with python 3.3 to 3.13+
6+
if sys.version_info > (3, 8):
7+
__name__ = __spec__.name
8+
__package__ = __spec__.parent
9+
510
# Clear module cache to force reloading all modules of this package.
611
prefix1 = __package__ + "." # sub modules of Package Control package
712
prefix2 = "package_control." # sub modules of package_control namespace package

0 commit comments

Comments
 (0)