Skip to content

Remove Python 2 support.

Per the discussion in #243, this MR removes Python 2 compatibility. Namely, this merge request:

  • removes code behind sys and platform interpreter version checks
  • removes unicode vs. str handling
  • removes unnecessary __future__ imports
  • removes unnecessary object inheritance
  • removes unnecessary super() arguments
  • uncomments commented-out code with "uncomment when python3 only" notes or some variant of that message

Regarding the unicode vs. str handling, it's arguably more Pythonic to check isinstance(x, str) as opposed to type(x) is str, but I didn't want to alter code behavior.

A change needs to be made to the INCOMPLETE_COVERAGE setting in utils/test/Makefile to get the pipeline to pass. I didn't get anywhere tweaking the setting myself, so someone else with more AppArmor experience will have to make that change.

Merge request reports