File tree Expand file tree Collapse file tree 1 file changed +8
-9
lines changed
Expand file tree Collapse file tree 1 file changed +8
-9
lines changed Original file line number Diff line number Diff line change 2626 ), session = 'None' )
2727
2828# Try to write VERSION file from Travis tag
29- TRAVIS_TAG = environ .get ('TRAVIS_TAG' ). strip ()
30- if TRAVIS_TAG :
29+ TRAVIS_TAG = environ .get ('TRAVIS_TAG' )
30+ if TRAVIS_TAG and TRAVIS_TAG . strip () :
3131 with open ('VERSION' , 'w' ) as version_file :
32- version_file .write (TRAVIS_TAG )
32+ version_file .write (TRAVIS_TAG . strip () )
3333
3434# Try to read VERSION from file
35- with open ('VERSION' , 'r' ) as version_file :
36- VERSION = version_file .read ().strip ()
37-
38- # If VERSION is not defined, raise error
39- if not VERSION :
40- raise EnvironmentError ('VERSION not defined.' )
35+ try :
36+ with open ('VERSION' , 'r' ) as version_file :
37+ VERSION = version_file .read ().strip ()
38+ except IOError :
39+ raise EnvironmentError ('VERSION file could not be read.' )
4140
4241PACKAGES = find_packages (exclude = ['tests*' ])
4342
You can’t perform that action at this time.
0 commit comments