PY2 fix with absolute import

This commit is contained in:
Ivan Kravets
2019-09-27 18:53:58 +03:00
parent 1b74f380a6
commit 9a3dcd3daa
2 changed files with 5 additions and 4 deletions

View File

@ -23,7 +23,6 @@ from tempfile import mkstemp
from SCons.Action import Action # 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.compat import get_file_contents, glob_escape
@ -295,17 +294,17 @@ def VerboseAction(_, act, actstr):
def PioClean(env, clean_dir):
if not isdir(clean_dir):
print("Build environment is clean")
print ("Build environment is clean")
env.Exit(0)
clean_rel_path = relpath(clean_dir)
for root, _, files in walk(clean_dir):
for f in files:
dst = join(root, f)
remove(dst)
print(
print (
"Removed %s" % (dst if clean_rel_path.startswith(".") else relpath(dst))
)
print("Done cleaning")
print ("Done cleaning")
fs.rmtree(clean_dir)
env.Exit(0)

View File

@ -12,6 +12,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
from __future__ import absolute_import
import sys
from os import environ
from os.path import join