def calculate_sum(numbers):
    sum = 0
    for num in numbers:
        sum += num
    return sum
编辑给定的代码添加错误处理。
def calculate_sum(numbers):
    try:
        sum = 0
        for num in numbers:
            sum += num
        return sum
    except TypeError:
        print("给定的输入不是整数列表。")