如果其他人在寻找答案时遇到这个问题,我通过对入口点进行硬编码来让它工作。我必须按如下方式更新load_scmclients()
函数:rbtools/clients/__init__.py
import imp
def main_is_frozen():
return (hasattr(sys, "frozen") or # new py2exe
hasattr(sys, "importers") # old py2exe
or imp.is_frozen("__main__")) # tools/freeze
from rbtools.clients.svn import SVNClient
from rbtools.clients.git import GitClient
from rbtools.clients.mercurial import MercurialClient
from rbtools.clients.cvs import CVSClient
from rbtools.clients.perforce import PerforceClient
from rbtools.clients.plastic import PlasticClient
from rbtools.clients.clearcase import ClearCaseClient
from rbtools.clients.bazaar import BazaarClient
def load_scmclients(options):
global SCMCLIENTS
SCMCLIENTS = {}
if not main_is_frozen():
for ep in pkg_resources.iter_entry_points(group='rbtools_scm_clients'):
try:
SCMCLIENTS[ep.name] = ep.load()(options=options)
except Exception, e:
logging.error('Could not load SCM Client "%s": %s' % (ep.name, e))
else:
temp_clients = {}
temp_clients['svn'] = SVNClient
temp_clients['git'] = GitClient
temp_clients['mercurial'] = MercurialClient
temp_clients['cvs'] = CVSClient
temp_clients['perforce'] = PerforceClient
temp_clients['plastic'] = PlasticClient
temp_clients['clearcase'] = ClearCaseClient
temp_clients['bazaar'] = BazaarClient
for ep in temp_clients:
try:
SCMCLIENTS[ep] = temp_clients[ep](options=options)
except Exception, e:
logging.error('Could not load SCM Client "%s": %s' % (str(ep), e))