Limitation on income earned in restricted country
(A) In general If travel (or any transaction in connection with such travel) with respect to any foreign country is subject to the regulations described in subparagraph (B) during any period— (i) the term “foreign earned income” shall not include any income from sources within such country attributable to services performed during such period, (ii) the term “housing expenses” shall not include any expenses allocable to such period for housing in such country or for housing of the spouse or dependents of the taxpayer in another country while the taxpayer is present in such country, and (iii) an individual shall not be treated as a bona fide resident of, or as present in, a foreign country for any day during which such individual was present in such country during such period.
(B) Regulations For purposes of this paragraph, regulations are described in this subparagraph if such regulations— (i) have been adopted pursuant to the Trading With the Enemy Act ( 50 U.S.C. 4301 et seq.) or the International Emergency Economic Powers Act ( 50 U.S.C. 1701 et seq.), and (ii) include provisions generally prohibiting citizens and residents of the United States from engaging in transactions related to travel to, from, or within a foreign country.
(C) Exception Subparagraph (A) shall not apply to any individual during any period in which such individual’s activities are not in violation of the regulations described in subparagraph (B).