|
75 | 75 | if __installed_packages_path is None: |
76 | 76 | raise FileNotFoundError('Installed Packages') |
77 | 77 |
|
| 78 | +assert __data_path |
| 79 | + |
78 | 80 | if PREFIX: |
79 | 81 | __data_path = PREFIX + __data_path |
80 | 82 | __default_packages_path = PREFIX + __default_packages_path |
@@ -151,28 +153,25 @@ def lib_paths(): |
151 | 153 | try: |
152 | 154 | return lib_paths.cache |
153 | 155 | except AttributeError: |
| 156 | + assert __data_path |
154 | 157 | st_version = int(sublime.version()) |
155 | | - if st_version > 4000: |
156 | | - root = os.path.dirname(__executable_path) |
157 | | - fext = ".exe" if sublime.platform() == "windows" else "" |
| 158 | + if st_version >= 4203: |
| 159 | + lib_paths.cache = {"3.14": os.path.join(__data_path, "Lib", "python314")} |
| 160 | + elif st_version >= 4201: |
| 161 | + lib_paths.cache = {"3.13": os.path.join(__data_path, "Lib", "python313")} |
| 162 | + elif st_version >= 4000: |
| 163 | + lib_paths.cache = {"3.8": os.path.join(__data_path, "Lib", "python38")} |
| 164 | + else: |
| 165 | + lib_paths.cache = {"3.3": os.path.join(__data_path, "Lib", "python3.3")} |
158 | 166 |
|
| 167 | + if st_version >= 4194: |
159 | 168 | settings = sublime.load_settings("Preferences.sublime-settings") |
160 | | - data = ( |
161 | | - ("3.3", "python33", not settings.get('disable_plugin_host_3.3', False)), |
162 | | - ("3.8", "python38", True), |
163 | | - ("3.13", "python313", True), |
164 | | - ("3.14", "python314", True), |
165 | | - ) |
166 | | - lib_paths.cache = { |
167 | | - py_ver: os.path.join(__data_path, "Lib", py_dir) |
168 | | - for py_ver, py_dir, enable in data |
169 | | - if enable and os.path.isfile(os.path.join(root, "plugin_host-" + py_ver + fext)) |
170 | | - } |
| 169 | + if not settings.get("disable_plugin_host_3.3", False): |
| 170 | + root = os.path.dirname(__executable_path) |
| 171 | + fext = ".exe" if sublime.platform() == "windows" else "" |
| 172 | + if os.path.isfile(os.path.join(root, "plugin_host-3.3" + fext)): |
| 173 | + lib_paths.cache["3.3"] = os.path.join(__data_path, "Lib", "python33") |
171 | 174 |
|
172 | | - else: |
173 | | - lib_paths.cache = { |
174 | | - "3.3": os.path.join(__data_path, "Lib", "python3.3") |
175 | | - } |
176 | 175 | return lib_paths.cache |
177 | 176 |
|
178 | 177 |
|
|
0 commit comments