Permalink
Browse files

fix IndexError on sys.argv

  • Loading branch information...
1 parent 4e743de commit 49ae8c7c3c3ca322bf66926393d88dea2d8a80f9 @ross committed May 13, 2011
Showing with 8 additions and 1 deletion.
  1. +8 −1 webassets_dynamic/__init__.py
@@ -31,7 +31,14 @@ def get_path(self, name):
helper = URLPatternHelper()
# TODO: should find a better way to get at this
-mode = sys.argv[1]
+# by default we're in 'serve' mode
+mode = ''
+try:
+ # if there's an argv[1] grab it as it will tell us we're in assets mode
+ mode = sys.argv[1]
+except:
+ pass
+
def dynamic_assets(name, file):
if mode == 'assets':
return join(helper.get_path(name), file)

0 comments on commit 49ae8c7

Please sign in to comment.