Has something gone haywire? Let us know about it!
-
Scorbie
- Posts: 1692
- Joined: December 7th, 2013, 1:05 am
-
Quote
-
Login to like this post
Post
by Scorbie » September 11th, 2016, 11:35 am
I am using golly 2.8b1 and the following code results in an error.
I couldn't get the unittest module to work because of this, but I gave up to use it anyway, so not too important.
Edit: the error message:
Code: Select all
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/home/scorbie/.golly/golly_clip.py", line 2, in <module>
sys.stderr.flush()
AttributeError: StderrCatcher instance has no attribute 'flush'
-
Andrew
- Moderator
- Posts: 942
- Joined: June 2nd, 2009, 2:08 am
- Location: Melbourne, Australia
-
Contact:
-
Quote
-
Login to like this post
Post
by Andrew » September 13th, 2016, 11:15 pm
The error happens because Golly redefines sys.stderr to an internal class (StderrCatcher) that captures all error messages in a string that Golly can then display in a dialog box.
You could probably avoid the error by doing something like "sys.stderr.flush = pass" after importing sys.
-
Scorbie
- Posts: 1692
- Joined: December 7th, 2013, 1:05 am
-
Quote
-
Login to like this post
Post
by Scorbie » September 16th, 2016, 10:40 am
Andrew wrote:You could probably avoid the error by doing something like "sys.stderr.flush = pass" after importing sys.
Ah! I'll try that next time. Thanks!