update symlink builder to be python 3 compatible

This commit is contained in:
Radim Kolar 2019-08-16 14:33:39 +02:00
parent 48dd1ed65a
commit da896e5a89

View File

@ -1,8 +1,8 @@
# #
# Symlink SCons builder # Symlink SCons builder
# #
# Version 1.0 # Version 1.1
# 02-Aug-2009 # 16-Aug-2019
# #
def Symlink(target, source, env=None): def Symlink(target, source, env=None):
@ -18,11 +18,11 @@ def Symlink(target, source, env=None):
""" """
import os import os
if not isinstance(target, list): if not isinstance(target, list):
raise TypeError,"target must be list" raise TypeError("target must be list")
elif not isinstance(source, list): elif not isinstance(source, list):
raise TypeError,"source must be list" raise TypeError("source must be list")
if len(target) != len(source): if len(target) != len(source):
raise ValueError,"target and source list must have same size" raise ValueError("target and source list must have same size")
for i in range(0,len(target)): for i in range(0,len(target)):
try: try:
os.unlink(str(target[i])) os.unlink(str(target[i]))