if not platform.startswith('win'):
from os import ttyname # here because it doesn't work on windows
import sys
- with open(ttyname(0), 'w') as fout:
- sys.stdout = fout
- print('version: ' + self.build_version) # self.eng.logic.version)
+ try:
+ with open(ttyname(0), 'w') as fout:
+ sys.stdout = fout
+ print('version: ' + self.build_version) # self.eng.logic.version)
+ except OSError: # it doesn't work with crontab
+ print('version: ' + self.build_version)
messages = ['version: ' + self.build_version] # self.eng.logic.version]
messages += ['argv[0]: %s' % argv[0]]
messages += ['getcwd: %s' % getcwd()]