@staticmethod
def _get_error_code(error_value):
    """Get the error code from the error_value accounting for Python
        version differences.

        :rtype: int

        """
    if not error_value:
        return None
    return error_value.errno
