def getBuildStepVersion(step):
  """Return the unpickled builder's persistenceVersion.

  The version reported in buildstep.persistenceVersion is what the currently
  loaded version of buildbot expects a step to be (instead of what is pickled).
  This returns what has been pickled.
  """
  return getattr(step,
                 'buildbot.status.builder.BuildStepStatus.persistenceVersion')