Switch Python or Platform dependent code to "compat" module

This commit is contained in:
Ivan Kravets committed 2019-05-10 17:50:08 +03:00
1 parent 834206ff20
commit 5e1a931145
2 files changed
+6 -4

No files matched your search

+3 -2
View File
@@ -26,6 +26,7 @@ import requests
import semantic_version
from platformio import __version__, app, exception, telemetry, util
from platformio.compat import path_to_unicode
from platformio.downloader import FileDownloader
from platformio.lockfile import LockFile
from platformio.unpacker import FileUnpacker
@@ -392,7 +393,7 @@ class PkgInstallerMixin(object):
if "version" not in manifest:
manifest['version'] = "0.0.0"
manifest['__pkg_dir'] = util.path_to_unicode(pkg_dir)
manifest['__pkg_dir'] = path_to_unicode(pkg_dir)
self.cache_set(cache_key, manifest)
return manifest
@@ -449,7 +450,7 @@ class PkgInstallerMixin(object):
def get_package_by_dir(self, pkg_dir):
for manifest in self.get_installed():
if manifest['__pkg_dir'] == util.path_to_unicode(abspath(pkg_dir)):
if manifest['__pkg_dir'] == path_to_unicode(abspath(pkg_dir)):
return manifest
return None