During any period when a trust is deemed to be a charitable trust or a private foundation, the trustee shall distribute its income for each taxable year (and principal if necessary) at a time and in a manner that will not subject the property of the trust to tax under Section 4942 of the Internal Revenue Code.