<s> from vcs . exceptions import VCSError <EOL> def import_class ( class_path ) : <EOL> """<STR_LIT>""" <EOL> splitted = class_path . split ( '<STR_LIT:.>' ) <EOL> mod_path = '<STR_LIT:.>' . join ( splitted [ : - <NUM_LIT:1> ] ) <EOL> class_name = splitted [ - <NUM_LIT:1> ] <EOL> try : <EOL> class_mod = __import__ ( mod_path , { } , { } , [ class_name ] ) <EOL> except ImportError , err : <EOL> msg = "<STR_LIT>" "<STR_LIT>" % err <EOL> raise VCSError ( msg ) <EOL> cls = getattr ( class_mod , class_name ) <EOL> return cls </s>
