This should do nothing in your modmod, if you followed my advice
here .
There is a mistake in the code is that major leaders are checked that way, but minor leaders are not. I'll try to fix that now.
updated RevCivUtils. I think the problems are solved.
Magister: I think you have to change CvRevInterface as described in the post I linked. After ALL leaders are chosen, the puppet states C++ code (probably) chooses a duplicate leader, but in a mod with about 70 leaders and 50 allowed players I think this problem can be neglected for now.
I did so yesterday, and merged my RevCivUtils.py with the new one you posted. (I included everything you had changed from the More Naval AI version on which mine was based, but kept my changes like blocking checking for religious weightings of -100 instead of just the agnostic trait, blocking most new civs from having religious rebellions for the new religions, etc.)
Today it doesn't seem like rebellions as working as well. In my current game as Auric Ulvin of he Illians, the first city to rebel did so under Tethira of the Bannor instead of an Illian minor leader. (I had been trying to get Riuros/Dumannios/Anagantios to form in order to test some changes to the code that causes the named priest units to switch sides and become their avatar.) It didn't even have any Bannor culture, not any religion but The Hand. (I was unhappy enough with that to go back and load the most recent autosave and prevent the rebellion.) The next rebellion events didn't really seem to go anywhere. I got some warnings but no followups for a long time. Eventually I got a python exception. I forgot to write down what all it said before going back loading an autosave, but I recall that it said there was something out of the bounds of a list around line 110 of RevCivUtils.py. When I loaded the autosave I was able to play at least 3 turns past that without incident. After the Bannor/Mercurian alliance and their Kuriotates vassal declared war on me, one of my cities (a captured barbarian one bordering the Kuriotates but far from the Bannor) tried to rebel and form Tethira of the Bannor again.
I'm thinking this indicates an issue either with your code or with your suggestion to change iSplitType = RevCivUtils.SPLIT_PUPPET to iSplitType = RevCivUtils.SPLIT_FORCED, as the Illian minor leaders were being chosen just fine before those changes.
Edit: I don't think if it is relevant, but just in case I thought I'd remind you that in my modmod I added all the minor leaders as possible leaders of the dummy CIVILIZATION_RANDOM. When the Unrestricted Leaders option is used, that allows players to choose to start as a minor leader. Otherwise, the game seems to treat them the same as RANDOM_GOOD, RANDOM_NEUTRAL, and RANDOM_EVIL, ignoring everything but the leader's alignment and replacing them with a leaders of the same alignment.
Edit2: This is completely unrelated, but I don't suppose I could convince Tholal (or anyone working with him on the DLL) to add a new tag to promotions to allow units to move through impassible terrain, could I?
I'd really like to let Dwarven and/or Runes units (including civilians like workers and great persons) purchase a promotion they lets them move through peaks, but I really do not want them to have flat movement costs or the ability to cross water like the bFlying tag grants.