pepper and bugs

In 1984 there is a part in chapter 5 that describes how Julia and Winston “would sprinkle everything with pepper bought on the black market” to keep the bugs away. I have never heard of anyone doing this. Does pepper really keep bugs away?