Search code examples
pythongerritattributeerror

gerrit error : Nonetype object has no attribute split


I am creating local repository for gerrit.

when I execute the command :

git-review -s

it gives me error as :

branch_parts = branch_name.split("/")
AttributeError: 'NoneType' object has no attribute 'split'

can anyone let me know how to solve the same?


Solution

  • This happens if your value is None

    In [119]: branch_name = None
    
    In [120]: branch_parts = branch_name.split("/")
    ---------------------------------------------------------------------------
    AttributeError                            Traceback (most recent call last)
    
    /home/avasal/<ipython console> in <module>()
    
    AttributeError: 'NoneType' object has no attribute 'split'
    

    Make sure the value in branch_name is as expected