Skip to content
Browse files

Pylint cleanup round 2.

  • Loading branch information...
1 parent f04b3db commit 935ccfa076e312c233e1a215c7975512ae3e950e @jk0 jk0 committed Oct 23, 2011
Showing with 3 additions and 6 deletions.
  1. +3 −2 pyhole/config.py
  2. +0 −3 pyhole/utils.py
  3. +0 −1 pyhole/version.py
View
5 pyhole/config.py
@@ -34,7 +34,6 @@ def __init__(self, config, section):
try:
with open(self.config) as conf_file:
self.config_parser.readfp(conf_file)
- conf_file.closed
except IOError:
print "Unable to load configuration file: %s" % self.config
utils.generate_config()
@@ -58,7 +57,9 @@ def get(self, option, **kwargs):
elif _type == "bool":
return self.config_parser.getboolean(self.section, option)
elif _type == "list":
- return self.config_parser.get(self.section, option).split(", ")
+ value = self.config_parser.get(self.section, option)
+ if hasattr(value, "split"):
+ return value.split(", ")
else:
return self.config_parser.get(self.section, option)
except ConfigParser.NoOptionError:
View
3 pyhole/utils.py
@@ -130,7 +130,6 @@ def write_file(dir, file, data):
with open(dir + file, "w") as f:
f.write(str(data).strip())
- f.closed
def read_file(dir, file):
@@ -140,7 +139,6 @@ def read_file(dir, file):
try:
with open(dir + file, "r") as f:
data = f.read()
- f.closed
return data
except IOError:
@@ -195,5 +193,4 @@ def generate_config():
print "Generating..."
with open(conf_file, "w") as f:
f.write(example)
- f.closed
print "Done"
View
1 pyhole/version.py
@@ -38,7 +38,6 @@ def current_git_hash():
with open(git_path, "r") as git:
git_hash = git.read()
- git.closed
return git_hash[0:5]

0 comments on commit 935ccfa

Please sign in to comment.
Something went wrong with that request. Please try again.