mirror of
https://github.com/platformio/platformio-core.git
synced 2025-07-30 10:07:14 +02:00
PY2 fix with absolute import
This commit is contained in:
@ -23,7 +23,6 @@ from tempfile import mkstemp
|
|||||||
|
|
||||||
from SCons.Action import Action # pylint: disable=import-error
|
from SCons.Action import Action # pylint: disable=import-error
|
||||||
from SCons.Script import ARGUMENTS # pylint: disable=import-error
|
from SCons.Script import ARGUMENTS # pylint: disable=import-error
|
||||||
from SCons.Script import COMMAND_LINE_TARGETS # pylint: disable=import-error
|
|
||||||
|
|
||||||
from platformio import fs, util
|
from platformio import fs, util
|
||||||
from platformio.compat import get_file_contents, glob_escape
|
from platformio.compat import get_file_contents, glob_escape
|
||||||
@ -295,17 +294,17 @@ def VerboseAction(_, act, actstr):
|
|||||||
|
|
||||||
def PioClean(env, clean_dir):
|
def PioClean(env, clean_dir):
|
||||||
if not isdir(clean_dir):
|
if not isdir(clean_dir):
|
||||||
print("Build environment is clean")
|
print ("Build environment is clean")
|
||||||
env.Exit(0)
|
env.Exit(0)
|
||||||
clean_rel_path = relpath(clean_dir)
|
clean_rel_path = relpath(clean_dir)
|
||||||
for root, _, files in walk(clean_dir):
|
for root, _, files in walk(clean_dir):
|
||||||
for f in files:
|
for f in files:
|
||||||
dst = join(root, f)
|
dst = join(root, f)
|
||||||
remove(dst)
|
remove(dst)
|
||||||
print(
|
print (
|
||||||
"Removed %s" % (dst if clean_rel_path.startswith(".") else relpath(dst))
|
"Removed %s" % (dst if clean_rel_path.startswith(".") else relpath(dst))
|
||||||
)
|
)
|
||||||
print("Done cleaning")
|
print ("Done cleaning")
|
||||||
fs.rmtree(clean_dir)
|
fs.rmtree(clean_dir)
|
||||||
env.Exit(0)
|
env.Exit(0)
|
||||||
|
|
||||||
|
@ -12,6 +12,8 @@
|
|||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
|
|
||||||
|
from __future__ import absolute_import
|
||||||
|
|
||||||
import sys
|
import sys
|
||||||
from os import environ
|
from os import environ
|
||||||
from os.path import join
|
from os.path import join
|
||||||
|
Reference in New Issue
Block a user