Wearing a police uniform

I bought a secondhand skirt and blouse from a mitumba shop that looks like a uniform normally worn by female prison wardens. My friends are telling me that it is an offence to wear such clothes and I can be prosecuted if am found wearing it. Is there any legal substance in this threat?
TT, Dar

Section 178 of the Penal Code [Cap.16 R.E 2019] prohibits civilians from wearing uniform or attire having the appearance or bearing of any of the regimental or other distinct marks of the Police or Tanzania People’s Defence Forces uniform without the permission of the President. A civilian can wear clothes or attire that resemble Police or Tanzania People’s Defence Forces uniform if such clothes or attire are worn for the purpose of stage play performed lawfully in public. However, even where the uniform or attire having the appearance of the Police or Tanzania People Defence Forces’ uniform is worn for the purpose public stage play, the wearing of such uniform or attire should not be in the manner that undermines it. It is an offence to undermine Police or Tanzania People’s Defence Forces uniform.

Unlawful wearing of a uniform or attire of Police or Tanzania People Defence Forces is an offence attracting a sentence of one month in prison or a fine of TZS 200,000.

However, section 178 does not criminalise wearing a uniform or attire having appearance of uniforms worn by prison wardens or other law enforcement agents like immigration. However, a person found wearing a uniform or attire of a prison warden or immigration officer may be charged with impersonation if the purpose of wearing the uniform is to assume the role of the prison warden or immigration officer.