Fix FlagEnum print issue by using build-in getattr() function

Using build-in getattr() seem to be able to avoid FlagEnum print issue.