From: Diane Trout Date: Fri, 20 Mar 2015 23:21:35 +0000 (-0700) Subject: replace xrange with enumerate X-Git-Url: http://woldlab.caltech.edu/gitweb/?p=htsworkflow.git;a=commitdiff_plain;h=7e9777356b3481a783591da3a4dd72b77ea8e801 replace xrange with enumerate --- diff --git a/htsworkflow/submission/daf.py b/htsworkflow/submission/daf.py index 90993de..7f5ed29 100644 --- a/htsworkflow/submission/daf.py +++ b/htsworkflow/submission/daf.py @@ -140,9 +140,9 @@ def _consume_whitespace(line, start=0): returns length of string if it can't find anything """ - for i in xrange(start, len(line)): - if line[i] not in string.whitespace: - return i + for i, c in enumerate(line[start:]): + if c not in string.whitespace: + return i+start return len(line) @@ -152,9 +152,9 @@ def _extract_name_index(line, start=0): returns length of string if nothing matches """ - for i in xrange(start, len(line)): - if line[i] in string.whitespace: - return i + for i, c in enumerate(line[start:]): + if c in string.whitespace: + return i+start return len(line)