flush= not supported until python-3.3

This commit is contained in:
Stuart D. Gathman
2016-07-26 09:58:30 -04:00
parent 76eb93223c
commit 999a446484
5 changed files with 14 additions and 9 deletions
+3 -2
View File
@@ -23,7 +23,7 @@ class sampleMilter(Milter.Milter):
def log(self,*msg):
print("%s [%d]" % (strftime('%Y%b%d %H:%M:%S'),self.id),end=None)
for i in msg: print(i,end=None)
print(flush=True)
print()
def __init__(self):
self.tempname = None
@@ -177,6 +177,7 @@ O InputMailFilters=pythonfilter
Xpythonfilter, S=local:%s
See the sendmail README for libmilter.
sample milter startup""" % socketname,flush=True)
sample milter startup""" % socketname)
sys.stdout.flush()
Milter.runmilter("pythonfilter",socketname,240)
print("sample milter shutdown")