From 590798d349cba7de6e83b43aa5d4f8b0a38e685d Mon Sep 17 00:00:00 2001 From: Vincent Jacques Date: Tue, 17 Apr 2012 18:18:09 +0100 Subject: [PATCH] Do not fail if Github adds an attribute in an object --- github/GithubObjects/GithubObject/GithubObject.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/github/GithubObjects/GithubObject/GithubObject.py b/github/GithubObjects/GithubObject/GithubObject.py index 30d515e9..f8b56fb8 100644 --- a/github/GithubObjects/GithubObject/GithubObject.py +++ b/github/GithubObjects/GithubObject/GithubObject.py @@ -84,8 +84,11 @@ def GithubObject( className, *attributePolicies ): def _updateAttributes( self, attributes ): for attributeName, attributeValue in attributes.iteritems(): - attributeDefinition = GithubObject.__attributeDefinitions[ attributeName ] - self.__attributes[ attributeName ] = attributeDefinition.getValueFromRawValue( self, attributeValue ) + try: + attributeDefinition = GithubObject.__attributeDefinitions[ attributeName ] + self.__attributes[ attributeName ] = attributeDefinition.getValueFromRawValue( self, attributeValue ) + except KeyError: + pass def _markAsCompleted( self ): for attributeName, attributeDefinition in GithubObject.__attributeDefinitions.iteritems():