Sort:  

it was inherited from the Indian Penal Code and was in place while the country was still under colonial rules