Revolutions python exception

Issue #317 wontfix
joseasoler repo owner created an issue

Comments (3)

  1. joseasoler reporter

    What happens in the savegame is that under pressure from rebel groups, someone ceded the control of a city to the Khazad. When the revolution code moves the city to the Khazad, the following exception is triggered:

    Traceback (most recent call last): File "BugEventManager", line 358, in _handleDefaultEvent File "Revolution", line 635, in onEndPlayerTurn File "Revolution", line 1078, in updatePlayerRevolution File "Revolution", line 2309, in checkForRevolution File "Revolution", line 2900, in pickRevolutionStyle File "Revolution", line 5008, in makeRevolutionDecision File "Revolution", line 5864, in processRevolution File "RevUtils", line 481, in getHandoverUnitTypes File "PyHelpers", line 1252, in getDescription AttributeError: 'NoneType' object has no attribute 'getDescription'

    The code fails in the following line of RevUtils:

    if( LOG_DEBUG and not bSilent ) : CvUtil.pyPrint("Revolt - Outdated unit %s (def)"%(PyInfo.UnitInfo(compUnitType).getDescription()))

    The problem is that the game is trying to grant a Longbowman to the Khazad, which are not able to build them. When the code reachs that line, PyInfo.UnitInfo(compUnitType) yields none and the exception is shown. Commenting the line out is an acceptable workaround (although it will grant a forbidden unit to the Khazad) but it would be more desirable to fix the Revolutions code to handle cases like this one.

  2. joseasoler reporter

    I was not able to reproduce this issue in More Naval AI after some hours of automated testing. I will give it another try before 0.6.0-beta.

  3. Log in to comment