From 56a0c12a59bb252d3b7d0929f9fb19b4d96a8437 Mon Sep 17 00:00:00 2001 From: Kelly Brazil Date: Sat, 4 Apr 2020 17:12:22 -0700 Subject: [PATCH] use in instead of find() --- jc/parsers/pip_list.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/jc/parsers/pip_list.py b/jc/parsers/pip_list.py index 5bcd5160..ba10d360 100644 --- a/jc/parsers/pip_list.py +++ b/jc/parsers/pip_list.py @@ -32,7 +32,7 @@ import jc.parsers.universal class info(): - version = '1.0' + version = '1.1' description = 'pip list command parser' author = 'Kelly Brazil' author_email = 'kellyjonbrazil@gmail.com' @@ -94,7 +94,7 @@ def parse(data, raw=False, quiet=False): cleandata = list(filter(None, linedata)) # detect legacy output type - if cleandata[0].find(' (') != -1: + if ' (' in cleandata[0]: for row in cleandata: raw_output.append({'package': row.split(' (')[0], 'version': row.split(' (')[1].rstrip(')')}) @@ -103,7 +103,7 @@ def parse(data, raw=False, quiet=False): else: # clear separator line for i, line in reversed(list(enumerate(cleandata))): - if line.find('---') != -1: + if '---' in line: cleandata.pop(i) cleandata[0] = cleandata[0].lower()