We investigated the behaviour of a capacitive humidity transducer (Vaisala HMP 234) upon pressure exposure of nitrogen and helium up to 100 bar, using a humidity generator based on saturation of the gases at temperatures below ambient. The increased saturated vapour pressure of water in the presence of nitrogen and helium (enhancement effect) was quantitatively taken into account. The sensor output was found to decrease with nitrogen pressure at fixed relative humidity (RH). Still, by taking the total pressure as an independent calibration parameter, the device can be used in nitrogen gas within error bounds of ±1% RH. For helium no deviation of the sensor output with pressure was observed, showing that the deviation strongly depends on gas properties. For similar pressure calibrations in other gases, accurate data of enhancement factors have to be available.