By default, division in Python 3, gives you floating number. And you cannot use a floating point number as a list's index.
You might want to use integer division in this case, like this
tempLeftArray = array[:length // 2]
tempRightArray = array[length // 2:]
In Python 2.x,
print(4 / 2)
# 2
print(4.0 / 2)
# 2.0
print(4.0 // 2)
# 2.0
print(4 // 2)
# 2
In Python 3.4,
print(4 / 2)
# 2.0
print(4.0 / 2)
# 2.0
print(4.0 // 2)
# 2.0
print(4 // 2)
# 2