-2
我有下面的代码:NoneType”对象有没有属性‘分裂’
def parse_pipeline(self, pipeline):
"""
Parse the pipeline template into a fully expanded pipeline string.
@type pipeline: str
@rtype: str
"""
pipeline = " ".join(pipeline.split())
self.debug('Creating pipeline, template is %s', pipeline)
if pipeline == '' and not self.eaters:
raise TypeError("Need a pipeline or a eater")
if pipeline == '':
# code of dubious value
assert self.eaters
pipeline = 'fakesink signal-handoffs=1 silent=1 name=sink'
pipeline = self.add_default_eater_feeder(pipeline)
pipeline = self.parse_tmpl(pipeline,
{'eater:': self.get_eater_template,
'feeder:': self.get_feeder_template})
self.debug('pipeline is %s', pipeline)
assert self.DELIMITER not in pipeline
return pipeline
当它运行时,我得到:
Setup failed: failure <type 'exceptions.AttributeError'> at
flumotion/component/feedcomponent.py:443: parse_pipeline():
'NoneType' object has no attribute 'split' (flumotion/component/component.py:586)
我试着打印pipeline
,以检查它是否是无,但事实并非如此。
这条线有什么问题?
pipeline = " ".join(pipeline.split())
'pipeline'是在方法调用 – jozefg
期间无有是没有错的代码,从那里你打了吗? – filmor
这个方法里面的'print repr(pipeline)'*方法告诉你什么? –