"And do not make Allah an obstacle to your oaths, by being righteous, fearing Allah, and making peace between people." The interpretation of al-Hasan: A man would be told: "Why do you not show kindness to your father, your brother, or your relative, or do such and such an act of goodness?" He would reply: "I have sworn by Allah that I will not show him kindness, nor uphold ties with him, nor reconcile that which is between me and him." He would use Allah as an excuse. So Allah revealed: "And do not make Allah an obstacle to your oaths," meaning the oath; that is, do not use Allah as an excuse.
Muhammad said: The meaning is: Do not make Allah, by swearing by Him, a barrier to you from showing kindness. This is what al-Hasan intended.
Yahya narrated from al-Hasan ibn Dinar, from al-Hasan, from Abd al-Rahman ibn Samurah, who said: The Messenger of Allah (peace be upon him) said to me: "O Abd al-Rahman ibn Samurah, if you swear an oath and then see that something else is better than it, then perform that which is better and offer expiation for your oath."