Every person having a knowledge of the actual commission of any offense punishable by death or by imprisonment in the penitentiary for life, who shall take any money or property of another, or any gratuity or reward, or any engagement or promise therefor, upon any agreement or understanding, express or implied, to compound or conceal any such crime, or to abstain from any prosecution thereof, or to withhold any evidence thereof, shall, upon conviction, be punished by imprisonment in the penitentiary not exceeding five years, or in the county jail not exceeding one year.