<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def list_locations(self):
 """Print known dist-locations and exit. """

        known = self.defaults.get_known_locations()
        for default in self.defaults.distdefault:
            if default not in known:
                known.add(default)
        if not known:
            err_exit('No locations', 0)
        for location in sorted(known):
            if location in self.defaults.distdefault:
                print(location, '(default)')
            else:
                print(location)
        sys.exit(0)