فهرست منبع

revert the ignore AssertionError commit

Son NK 4 سال پیش
والد
کامیت
d99d186bc0
1فایلهای تغییر یافته به همراه4 افزوده شده و 8 حذف شده
  1. 4 8
      email_handler.py

+ 4 - 8
email_handler.py

@@ -1251,14 +1251,10 @@ class MailHandler:
             smtp = SMTP(POSTFIX_SERVER, POSTFIX_PORT or 25)
             smtp = SMTP(POSTFIX_SERVER, POSTFIX_PORT or 25)
 
 
         app = new_app()
         app = new_app()
-        try:
-            with app.app_context():
-                ret = await handle(envelope, smtp)
-                LOG.debug("takes %s seconds <<===", time.time() - start)
-                return ret
-        # ignore the "Popped wrong app context" Assertion Error raised by AppContext
-        except AssertionError as e:
-            LOG.warning("Error %s", e)
+        with app.app_context():
+            ret = await handle(envelope, smtp)
+            LOG.debug("takes %s seconds <<===", time.time() - start)
+            return ret
 
 
 
 
 if __name__ == "__main__":
 if __name__ == "__main__":