git.99rst.org
/
redacted-XKCD-password-generator.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
| inline |
side by side
(parent:
23be606
)
removed use of 'with' for back-compatibility
author
Steven Tobin
<tobin2402 (at) gmail.com>
Sat, 2 Jun 2012 09:57:25 +0000
(10:57 +0100)
committer
Steven Tobin
<tobin2402 (at) gmail.com>
Sat, 2 Jun 2012 09:57:25 +0000
(10:57 +0100)
xkcd-password.py
patch
|
blob
|
history
diff --git
a/xkcd-password.py
b/xkcd-password.py
index fa3cb69322bcaa35376f9d89192744cdd97184be..98c19d43cd7439f61792cc03307d9d63c07f35b9 100755
(executable)
--- a/
xkcd-password.py
+++ b/
xkcd-password.py
@@
-72,11
+72,12
@@
def generate_wordlist(wordfile=None,
words = []
regexp = re.compile("^%s{%i,%i}$" % (valid_chars, min_length, max_length))
try:
- with open(wordfile) as wlf:
- for line in wlf:
- thisword = line.strip()
- if regexp.match(thisword) is not None:
- words.append(thisword)
+ wlf = open(wordfile)
+ for line in wlf:
+ thisword = line.strip()
+ if regexp.match(thisword) is not None:
+ words.append(thisword)
+ wlf.close()
except:
print("Word list not loaded")
raise SystemExit
git clone https://git.99rst.org/PROJECT