]> git.phdru.name Git - phdru.name/phdru.name.git/commitdiff
gen-sitemap: fix a bug: args.exclude can be None
authorOleg Broytman <phd@phdru.name>
Mon, 16 Mar 2015 00:07:42 +0000 (03:07 +0300)
committerOleg Broytman <phd@phdru.name>
Wed, 23 Dec 2015 15:54:10 +0000 (18:54 +0300)
gen-sitemap.py

index aaff97a7c3001f77707b32876da324d3bc20b73a..333069f0122df57fdad96776356d9ed175467509 100755 (executable)
@@ -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()