<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def umask(self, new_mask):
 """Change the current umask. Args: new_mask: (int) The new umask value. Returns: The old umask. Raises: TypeError: if new_mask is of an invalid type. """

        if not is_int_type(new_mask):
            raise TypeError('an integer is required')
        old_umask = self.filesystem.umask
        self.filesystem.umask = new_mask
        return old_umask