X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=tools%2Finstall-decoders;h=465c70e45f5125515068d29ab5794ba057b844be;hb=7eb90f2304e10d13281d47d944168fe40a77e6d6;hp=8134539d35946597eaeace5862b37c7e796ce477;hpb=03d6d746b742fb21ca22086ba6b72943a845ecc9;p=libsigrokdecode.git diff --git a/tools/install-decoders b/tools/install-decoders index 8134539..465c70e 100755 --- a/tools/install-decoders +++ b/tools/install-decoders @@ -1,22 +1,22 @@ #!/usr/bin/env python3 -# -# This file is part of the libsigrokdecode project. -# -# Copyright (C) 2012 Bert Vermeulen -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 3 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, see . -# +## +## This file is part of the libsigrokdecode project. +## +## Copyright (C) 2013 Bert Vermeulen +## +## This program is free software; you can redistribute it and/or modify +## it under the terms of the GNU General Public License as published by +## the Free Software Foundation; either version 3 of the License, or +## (at your option) any later version. +## +## This program is distributed in the hope that it will be useful, +## but WITHOUT ANY WARRANTY; without even the implied warranty of +## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +## GNU General Public License for more details. +## +## You should have received a copy of the GNU General Public License +## along with this program; if not, see . +## import os import sys @@ -50,13 +50,16 @@ def install(srcdir, dstdir): col = 0 print(msg, end='') col += len(msg) - pd_dst = dstdir + '/' + pd + pd_dst = os.path.join(dstdir, pd) try: os.mkdir(pd_dst) - except FileExistsError: - pass + except OSError as e: + if e.errno != os.errno.EEXIST: + raise + else: + pass for f in install_list: - copy(pd_dir + '/' + f, pd_dst) + copy(os.path.join(pd_dir, f), pd_dst) print()