From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 07E5313835A for ; Fri, 16 Apr 2021 01:56:34 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id F324EE075F; Fri, 16 Apr 2021 01:56:32 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id D760CE075F for ; Fri, 16 Apr 2021 01:56:32 +0000 (UTC) Received: from oystercatcher.gentoo.org (unknown [IPv6:2a01:4f8:202:4333:225:90ff:fed9:fc84]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 7FA8F335C7A for ; Fri, 16 Apr 2021 01:56:31 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 049154A8 for ; Fri, 16 Apr 2021 01:56:30 +0000 (UTC) From: "Mike Frysinger" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Mike Frysinger" Message-ID: <1618535593.7748284a8002b4d3cf44cc0cd24738aebeb8b548.vapier@gentoo> Subject: [gentoo-commits] proj/pax-utils:master commit in: / X-VCS-Repository: proj/pax-utils X-VCS-Files: lddtree.py X-VCS-Directories: / X-VCS-Committer: vapier X-VCS-Committer-Name: Mike Frysinger X-VCS-Revision: 7748284a8002b4d3cf44cc0cd24738aebeb8b548 X-VCS-Branch: master Date: Fri, 16 Apr 2021 01:56:30 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: 4812344b-1e3f-4717-b77a-14fc04f0ad1f X-Archives-Hash: 2f32b4bf1b57fc8aef9d04a442cdbdc6 commit: 7748284a8002b4d3cf44cc0cd24738aebeb8b548 Author: Mike Frysinger chromium org> AuthorDate: Fri Apr 16 01:13:13 2021 +0000 Commit: Mike Frysinger gentoo org> CommitDate: Fri Apr 16 01:13:13 2021 +0000 URL: https://gitweb.gentoo.org/proj/pax-utils.git/commit/?id=7748284a lddtree: require Python 3.6+ Signed-off-by: Mike Frysinger gentoo.org> lddtree.py | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/lddtree.py b/lddtree.py index 3420b7d..b65c3f2 100755 --- a/lddtree.py +++ b/lddtree.py @@ -1,5 +1,4 @@ #!/usr/bin/env python -# -*- coding: utf-8 -*- # Copyright 2012-2014 Gentoo Foundation # Copyright 2012-2014 Mike Frysinger # Copyright 2012-2014 The Chromium OS Authors @@ -40,8 +39,6 @@ This will place bash, lspci, and lsof into /foo/bin/. All the libraries they need will be placed into /foo/lib/ only. """ -from __future__ import print_function - import argparse import glob import errno @@ -49,6 +46,8 @@ import os import shutil import sys +assert sys.version_info >= (3, 6), f'Python 3.6+ required, but found {sys.version}' + from elftools.elf.elffile import ELFFile from elftools.common import exceptions @@ -116,15 +115,6 @@ def readlink(path, root, prefixed=False): return normpath((root + path) if prefixed else path) -def makedirs(path): - """Like os.makedirs(), but ignore EEXIST errors""" - try: - os.makedirs(path) - except OSError as e: - if e.errno != errno.EEXIST: - raise - - def dedupe(items): """Remove all duplicates from |items| (keeping order)""" seen = {} @@ -596,7 +586,7 @@ def _ActionCopy(options, elf): if options.verbose: print('%s -> %s' % (src, dst)) - makedirs(os.path.dirname(dst)) + os.makedirs(os.path.dirname(dst), exist_ok=True) try: shutil.copy2(realsrc, dst) except IOError: