38 weeks pregnant

im 38 weeks prego i have a yeast infection & my doctor prescribed me 2 pills to take, i take my last one tomorrow. is it okay to have sex? or will it make my infection worse?