diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -16,7 +16,7 @@ except ImportError:
 major, minor1, minor2, release, serial = sys.version_info
 def read(filename):
     kwargs = {'encoding': 'utf-8'} if major > 3 else {}
-    with open(filename, **kwargs):
+    with open(filename, **kwargs) as f:
         return f.read()
 
 name = 'ptemcee'
@@ -24,7 +24,7 @@ name = 'ptemcee'
 # Get current version.
 pattern = re.compile('__version__\s*=\s*(\'|")(.*?)(\'|")')
 initPath = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'ptemcee/__init__.py')
-pattern.findall(read(initPath))[0][1]
+version = pattern.findall(read(initPath))[0][1]
 
 setup(
     name=name,
Fixed bug in setup.py.