From 5fda1388a484a663ea05c28cc887fd616a2568fa Mon Sep 17 00:00:00 2001 From: Guillaume Raffy Date: Thu, 21 Nov 2019 09:00:57 +0000 Subject: [PATCH] =?UTF-8?q?fixed=20bug=20that=20was=20introduced=20a=20few?= =?UTF-8?q?=20months=20ago=20that=20made=20Util.py=20incompatible=20with?= =?UTF-8?q?=20python2.=20However,=20intranet.ipr.univ-rennes1.fr=20still?= =?UTF-8?q?=20uses=20python2=20and=20as=20a=20result=20the=20web=20site=20?= =?UTF-8?q?was=20no=20longer=20functional=20once=20the=20we=20site=20was?= =?UTF-8?q?=20updated=20in=20Bug=202789=20-=20Faire=20en=20sorte=20que=20l?= =?UTF-8?q?a=20mise=20=C3=A0=20jour=20jour=20du=20site=20web=20du=20cluste?= =?UTF-8?q?r=20puisse=20se=20faire=20de=20graffy-ws2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Util.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/Util.py b/Util.py index d3616bf..317c354 100644 --- a/Util.py +++ b/Util.py @@ -6,9 +6,13 @@ import re # import os # import signal import smtplib -from email.mime.text import MIMEText -from html.parser import HTMLParser - +import sys +if sys.version_info < (3, 0): + from HTMLParser import HTMLParser + from email.MIMEText import MIMEText +else: + from html.parser import HTMLParser + from email.mime.text import MIMEText def sendTextMail(strFrom, to, strSubject, text): # from = "SimpaCluster "