public inbox for
help / color / mirror / Atom feed
From: Jon TURNEY <>
Subject: [calm - Cygwin server-side packaging maintenance script] branch master, updated. 20220627-4-g879bfc5
Date: Sat,  2 Jul 2022 21:07:09 +0000 (GMT)	[thread overview]
Message-ID: <> (raw);h=879bfc586924cdaf42fc425fb71e7e145b8752a0

commit 879bfc586924cdaf42fc425fb71e7e145b8752a0
Author: Jon Turney <>
Date:   Sat Jul 2 22:03:26 2022 +0100

    Ignore flake8-bugbear B023
    I seem to like writing code which I think legitimately use the construct
    this warns about.
    Drop ignoring B020, since false positives are fixed.;h=130b929a2c7d4fbc28bedcbdbac7214acdacf328

commit 130b929a2c7d4fbc28bedcbdbac7214acdacf328
Author: Jon Turney <>
Date:   Sat Jul 2 20:29:08 2022 +0100

    Only remove empty subdirectories below a certain depth
    'cygport upload/stage' assumes the existence of the '<arch>/release'
    directories, so don't remove those, even if empty.

 .flake8       | 2 +-
 calm/ | 8 ++++----
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/.flake8 b/.flake8
index 48e7f81..7c03237 100644
--- a/.flake8
+++ b/.flake8
@@ -1,5 +1,5 @@
 per-file-ignores =
diff --git a/calm/ b/calm/
index f25e5f4..bafc5ff 100644
--- a/calm/
+++ b/calm/
@@ -58,12 +58,12 @@ def makedirs(name):
-# remove any empty subdirectories
+# remove any empty subdirectories below a given depth
-def rmemptysubdirs(path):
+def rmemptysubdirs(path, depth=3):
     for (dirpath, _subdirs, _files) in os.walk(path, topdown=False, followlinks=True):
-        # don't remove the given directory, only subdirectories
-        if os.path.relpath(dirpath, path) == '.':
+        # don't do anything while above the given depth
+        if len(os.path.relpath(dirpath, path).split(os.sep)) < depth:
         # check whether the directory is now empty after processing any

                 reply	other threads:[~2022-07-02 21:07 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \ \ \ \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).