From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on sa.local.altlinux.org X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ya.ru; s=mail; t=1508572819; bh=bdMXQbWlbNyqDnRvdx4bMYOhE7jn347UHxR3xewo3Ac=; h=Subject:To:References:From:Message-ID:Date:In-Reply-To; b=t4WSUssuh83wj185HQnnQ0AE73t+QxB9gHwmnIp1XyPj2/GPLaT7B4l4mNi3F9Gld 5YIOxwlBoJB3RthZqZWRnXwNzLPRId2xjljdmTAl0pbpt6Bkxxy7GlZXkt36d9vVnW il+rMowFH56PNIjnWHcSxlZZ8n7ptVzqLFXwHWJo= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ya.ru; s=mail; t=1508572818; bh=bdMXQbWlbNyqDnRvdx4bMYOhE7jn347UHxR3xewo3Ac=; h=Subject:To:References:From:Message-ID:Date:In-Reply-To; b=Q/dlhej3trhVXHmCl0XvIuWPsETUZBo5dP2wLnM+DyLI4LKbj40uBgD2WHNGy+zFB ymQNLO0P+KtSVphTcZBNfVRAZ1QSjtLWGw9t3wuKXC5PL0S5LlXCe5AGsPatmNGmzK AjMCoVO/fhorbDDLWLSx3UD8SX+BW1PLJ75PC7G8= Authentication-Results: smtp2o.mail.yandex.net; dkim=pass header.i=@ya.ru To: devel@lists.altlinux.org References: <558aa688-03e6-d324-f9d5-2118827f08ce@ya.ru> From: =?UTF-8?B?0JDQvdGC0L7QvSDQnNC40LTRjtC60L7Qsg==?= Message-ID: <3de80525-093c-4fad-9e9f-d757c8010908@ya.ru> Date: Sat, 21 Oct 2017 15:00:15 +0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=koi8-r; format=flowed Content-Transfer-Encoding: 8bit Content-Language: ru Subject: Re: [devel] python.req error X-BeenThere: devel@lists.altlinux.org X-Mailman-Version: 2.1.12 Precedence: list Reply-To: ALT Linux Team development discussions List-Id: ALT Linux Team development discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Oct 2017 08:00:21 -0000 Archived-At: List-Archive: List-Post: 21.10.2017 13:32, Vitaly Kuznetsov пишет: > On Sat, Oct 21, 2017 at 8:12 AM, Антон Мидюков wrote: >> Подскажите, пожалуйста, что не понравилось в синтаксисе python.req: >> >> python.req: ERROR: >> /usr/src/tmp/Uranium-buildroot/usr/lib/uranium/plugins/LocalFileOutputDevice/LocalFileOutputDevice.py: >> invalid syntax (line 159) >> Traceback (most recent call last): >> File "/usr/lib/rpm/python.req.py", line 230, in >> lis = parser.suite('\n'.join(lines)+'\n').tolist(line_info=1) >> File "", line 159 >> raise >> OutputDeviceError.PermissionDeniedError(catalog.i18nc("@info:status Don't >> translate the XML tags !", "Permission denied when trying to save >> {0}").format(file_name)) from e >> ^ >> SyntaxError: invalid syntax >> > raise ... from - это конструкция Python3: Понятно. А как мне сказать python.req, что этот файл написан на python3? Я пакет собираю для python3 исключительно. > $ python2 > Python 2.7.13 (default, Sep 5 2017, 08:53:59) > [GCC 7.1.1 20170622 (Red Hat 7.1.1-3)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. >>>> try: > ... 1/0 > ... except: > ... raise RuntimeError("Something bad happened") from None > File "", line 4 > raise RuntimeError("Something bad happened") from None > ^ > SyntaxError: invalid syntax > > $ python3 > Python 3.6.2 (default, Oct 2 2017, 16:51:32) > [GCC 7.2.1 20170915 (Red Hat 7.2.1-2)] on linux > Type "help", "copyright", "credits" or "license" for more information. >>>> try: > ... 1/0 > ... except: > ... raise RuntimeError("Something bad happened") from None > ... > Traceback (most recent call last): > File "", line 4, in > RuntimeError: Something bad happened > > https://docs.python.org/3/reference/simple_stmts.html#raise > https://docs.python.org/2.7/reference/simple_stmts.html#raise > _______________________________________________ > Devel mailing list > Devel@lists.altlinux.org > https://lists.altlinux.org/mailman/listinfo/devel -- С уважением, Антон Мидюков