From 2db9858ffea8e6e8d8f87112a2e6673f161dc982 Mon Sep 17 00:00:00 2001 From: Paul Sokolovsky Date: Wed, 14 May 2014 21:55:20 +0300 Subject: [PATCH] shutil: Decided to reimplement, start with shutil(). --- shutil/metadata.txt | 4 ++-- shutil/shutil.py | 9 +++++++++ 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/shutil/metadata.txt b/shutil/metadata.txt index 34e7b20b..c6134e1b 100644 --- a/shutil/metadata.txt +++ b/shutil/metadata.txt @@ -1,3 +1,3 @@ -srctype=dummy +srctype=micropython-lib type=module -version=0.0.1 +version=0.0.2 diff --git a/shutil/shutil.py b/shutil/shutil.py index e69de29b..737fa7ce 100644 --- a/shutil/shutil.py +++ b/shutil/shutil.py @@ -0,0 +1,9 @@ +# Reimplement, because CPython3.3 impl is rather bloated +import os + + +def rmtree(top): + for path, dirs, files in os.walk(top, False): + for f in files: + os.unlink(path + "/" + f) + os.rmdir(path)