aboutsummaryrefslogtreecommitdiffstats
path: root/whitelist.py
diff options
context:
space:
mode:
authorMatěj Cepl <mcepl@cepl.eu>2018-04-03 11:39:59 +0200
committerMatěj Cepl <mcepl@cepl.eu>2019-10-02 12:29:46 +0200
commit606078cabb24ddf1e2cb29175e6d7deae73f5749 (patch)
tree2105f8fbbbb6abbde70c14322d7dfc3c3ebc75be /whitelist.py
parentdf2683228cfb151dad3e78a624181af6fc771545 (diff)
downloadpygn-606078cabb24ddf1e2cb29175e6d7deae73f5749.tar.gz
Global variables are evil. Tests under both py2k and py3k pass.
Diffstat (limited to 'whitelist.py')
-rw-r--r--whitelist.py9
1 files changed, 2 insertions, 7 deletions
diff --git a/whitelist.py b/whitelist.py
index 7eb111e..d12aea3 100644
--- a/whitelist.py
+++ b/whitelist.py
@@ -40,14 +40,9 @@ class whitelist(object):
log_fh.setFormatter(log_fmt)
self.logger.addHandler(log_fh)
- try:
- wlp.setfilebyname(wlfile)
- except Exception as ex:
- self.logger.exception('Opening %s: %s', wlfile, ex)
- sys.exit(1)
-
# dict is a { ownername : {variable: value}} dictionary of dictionaries
- self.wl = wlp.mkdict()
+ with open(wlfile) as inf:
+ self.wl = wlp.mkdict(inf)
def checkfrom(self, fromhead):
"""have you permission to be here, sir?"""