From 3b607b20bbfbc5b8a2282d57b4c1f99f07f9d272 Mon Sep 17 00:00:00 2001 From: Oleg Broytman Date: Mon, 16 Mar 2015 03:07:42 +0300 Subject: [PATCH] gen-sitemap: fix a bug: args.exclude can be None --- gen-sitemap.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/gen-sitemap.py b/gen-sitemap.py index aaff97a..333069f 100755 --- a/gen-sitemap.py +++ b/gen-sitemap.py @@ -12,10 +12,11 @@ parser.add_argument('root_dir', help='Root dicrectory') args = parser.parse_args() exclude = [] -for pat in args.exclude: - exclude.append(pat) - if not pat.endswith('/*'): - exclude.append(pat + '/*') +if args.exclude: + for pat in args.exclude: + exclude.append(pat) + if not pat.endswith('/*'): + exclude.append(pat + '/*') os.chdir(args.root_dir) fullpath = os.getcwd() -- 2.39.5