kopia lustrzana https://github.com/micropython/micropython-lib
upip: Prepare to support standalone dependency modules for upip.
rodzic
5fd3d0d860
commit
3f79fc64d3
24
upip/upip.py
24
upip/upip.py
|
@ -1,16 +1,22 @@
|
||||||
import sys
|
def upip_import(mod):
|
||||||
import os
|
try:
|
||||||
import os.path
|
return __import__("upip_" + mod)
|
||||||
import errno
|
except ImportError:
|
||||||
import gzip
|
return __import__(mod)
|
||||||
|
|
||||||
|
sys = upip_import("sys")
|
||||||
|
os = upip_import("os")
|
||||||
|
os.path = upip_import("os.path").path
|
||||||
|
errno = upip_import("errno")
|
||||||
|
gzip = upip_import("gzip")
|
||||||
try:
|
try:
|
||||||
import utarfile as tarfile
|
tarfile = upip_import("utarfile")
|
||||||
except ImportError:
|
except ImportError:
|
||||||
import tarfile
|
tarfile = upip_import("tarfile")
|
||||||
try:
|
try:
|
||||||
import ujson as json
|
json = upip_import("ujson")
|
||||||
except ImportError:
|
except ImportError:
|
||||||
import json
|
json = upip_import("json")
|
||||||
|
|
||||||
|
|
||||||
DEFAULT_MICROPYPATH = "~/.micropython/lib:/usr/lib/micropython"
|
DEFAULT_MICROPYPATH = "~/.micropython/lib:/usr/lib/micropython"
|
||||||
|
|
Ładowanie…
Reference in New Issue