diff --git a/docs/conf.py b/docs/conf.py index aa897ef..62b5202 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -50,8 +50,8 @@ # built documents. # # The full version, including alpha/beta/rc tags. -init_py = open(os.path.join(os.path.dirname(__file__), - '..', 'cssselect', '__init__.py')).read() +with open(os.path.join(os.path.dirname(__file__), '..', 'cssselect', '__init__.py')) as init_file: + init_py = init_file.read() release = re.search("VERSION = '([^']+)'", init_py).group(1) # The short X.Y version. version = release.rstrip('dev') diff --git a/setup.py b/setup.py index bddda2e..3a0bea0 100644 --- a/setup.py +++ b/setup.py @@ -14,8 +14,10 @@ ROOT = os.path.dirname(__file__) -README = open(os.path.join(ROOT, "README.rst")).read() -INIT_PY = open(os.path.join(ROOT, "cssselect", "__init__.py")).read() +with open(os.path.join(ROOT, "README.rst")) as readme_file: + README = readme_file.read() +with open(os.path.join(ROOT, "cssselect", "__init__.py")) as init_file: + INIT_PY = init_file.read() VERSION = re.search("VERSION = '([^']+)'", INIT_PY).group(1) diff --git a/tox.ini b/tox.ini index f260626..372ecb9 100644 --- a/tox.ini +++ b/tox.ini @@ -26,7 +26,7 @@ commands = [testenv:pylint] deps = {[testenv]deps} - pylint==2.8.3 + pylint==2.9.5 commands = pylint {posargs: cssselect setup.py tests docs}