File tree Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Original file line number Diff line number Diff line change 22
33import os
44import re
5+ import sys
56
67from setuptools import setup , Extension
78
89
10+ def _open (filename ):
11+ if sys .version_info [0 ] == 2 :
12+ return open (filename )
13+ return open (filename , encoding = "utf-8" )
14+
15+
916# Defining setup variables:
1017defined_macros = dict ()
1118defined_macros ["CYTHON_CLINE_IN_TRACEBACK" ] = 0
1219
1320# Getting description:
14- with open ("README.rst" , encoding = "utf-8 " ) as readme_file :
21+ with _open ("README.rst" ) as readme_file :
1522 description = readme_file .read ()
1623
1724# Getting requirements:
18- with open ("requirements.txt" , encoding = "utf-8 " ) as requirements_file :
25+ with _open ("requirements.txt" ) as requirements_file :
1926 requirements = requirements_file .readlines ()
2027
2128# Getting version:
22- with open ("src/dependency_injector/__init__.py" , encoding = "utf-8 " ) as init_file :
29+ with _open ("src/dependency_injector/__init__.py" ) as init_file :
2330 version = re .search ("__version__ = \" (.*?)\" " , init_file .read ()).group (1 )
2431
2532# Adding debug options:
You can’t perform that action at this time.
0 commit comments