From f8a39e3bb13000e8952144be4c019d90d5ce7b94 Mon Sep 17 00:00:00 2001 From: Paul Sokolovsky Date: Wed, 3 Jun 2015 19:24:57 +0300 Subject: [PATCH] tools/make-frozen.py: Handle trailing slash in argument more reliably. --- tools/make-frozen.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/tools/make-frozen.py b/tools/make-frozen.py index f12e6f6db3..340a788617 100755 --- a/tools/make-frozen.py +++ b/tools/make-frozen.py @@ -26,16 +26,14 @@ def module_name(f): modules = [] -root = sys.argv[1] +root = sys.argv[1].rstrip("/") root_len = len(root) -if root[-1] != "/": - root_len += 1 for dirpath, dirnames, filenames in os.walk(root): for f in filenames: fullpath = dirpath + "/" + f st = os.stat(fullpath) - modules.append((fullpath[root_len:], st)) + modules.append((fullpath[root_len + 1:], st)) print("#include ") print("const uint16_t mp_frozen_sizes[] = {")