mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-11-27 21:29:24 +01:00
Let's use os.linesep instead.
This commit is contained in:
parent
b3dfdd1ed5
commit
dee61a32f1
@ -118,12 +118,15 @@ class BetterFileHandler(logging.FileHandler):
|
||||
def emit(self, record):
|
||||
msg = self.format(record)
|
||||
if not hasattr(types, "UnicodeType"): #if no unicode support...
|
||||
self.stream.write("%s\n" % msg)
|
||||
self.stream.write(msg)
|
||||
self.stream.write(os.linesep)
|
||||
else:
|
||||
try:
|
||||
self.stream.write("%s\n" % msg)
|
||||
self.stream.write(msg)
|
||||
self.stream.write(os.linesep)
|
||||
except UnicodeError:
|
||||
self.stream.write("%s\n" % msg.encode("UTF-8"))
|
||||
self.stream.write(msg.encode("utf8"))
|
||||
self.stream.write(os.linesep)
|
||||
self.flush()
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user