]> sigrok.org Git - libsigrokdecode.git/blobdiff - tools/install-decoders
tools/install-decoders: Minor consistency fix.
[libsigrokdecode.git] / tools / install-decoders
index 8134539d35946597eaeace5862b37c7e796ce477..465c70e45f5125515068d29ab5794ba057b844be 100755 (executable)
@@ -1,22 +1,22 @@
 #!/usr/bin/env python3
-#
-# This file is part of the libsigrokdecode project.
-#
-# Copyright (C) 2012 Bert Vermeulen <bert@biot.com>
-#
-# 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 <http://www.gnu.org/licenses/>.
-#
+##
+## This file is part of the libsigrokdecode project.
+##
+## Copyright (C) 2013 Bert Vermeulen <bert@biot.com>
+##
+## 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 <http://www.gnu.org/licenses/>.
+##
 
 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()