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 9D9D713835A for ; Tue, 4 May 2021 15:50:41 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id E8790E0837; Tue, 4 May 2021 15:50:40 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (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 4FE1CE0833 for ; Tue, 4 May 2021 15:50:40 +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 4B4E6335DA4 for ; Tue, 4 May 2021 15:50:39 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 9921074C for ; Tue, 4 May 2021 15:50:36 +0000 (UTC) From: "Ulrich Müller" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Ulrich Müller" Message-ID: <1620143288.20fe069692a9818c41059c3ebcfef3dce39c258e.ulm@gentoo> Subject: [gentoo-commits] proj/g-sorcery:master commit in: tests/ X-VCS-Repository: proj/g-sorcery X-VCS-Files: tests/server.py X-VCS-Directories: tests/ X-VCS-Committer: ulm X-VCS-Committer-Name: Ulrich Müller X-VCS-Revision: 20fe069692a9818c41059c3ebcfef3dce39c258e X-VCS-Branch: master Date: Tue, 4 May 2021 15:50:36 +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: 07d043f9-87b9-4f0d-81d9-cb3c9e3a9e43 X-Archives-Hash: 2d2f649ba433c024ef4d68ee75ff2846 commit: 20fe069692a9818c41059c3ebcfef3dce39c258e Author: Brian Dolbec gentoo org> AuthorDate: Thu Apr 23 17:39:09 2020 +0000 Commit: Ulrich Müller gentoo org> CommitDate: Tue May 4 15:48:08 2021 +0000 URL: https://gitweb.gentoo.org/proj/g-sorcery.git/commit/?id=20fe0696 tests/server/py: Fix an inheritence error in py 3.7, 3.8 self.directory was being overridden by the super class instance. Rename this local variable to prevent it being overridden. Signed-off-by: Brian Dolbec gentoo.org> Signed-off-by: Ulrich Müller gentoo.org> tests/server.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/tests/server.py b/tests/server.py index 6a32a2d..aa895ea 100644 --- a/tests/server.py +++ b/tests/server.py @@ -4,9 +4,9 @@ """ server.py ~~~~~~~~~ - + test server - + :copyright: (c) 2013 by Jauhien Piatlicki :license: GPL-2, see LICENSE for more details. """ @@ -18,7 +18,7 @@ import time from g_sorcery.compatibility import py2k if py2k: - from SocketServer import TCPServer as HTTPServer + from SocketServer import TCPServer as HTTPServer from SimpleHTTPServer import SimpleHTTPRequestHandler else: from http.server import HTTPServer @@ -27,24 +27,24 @@ else: def HTTPRequestHandlerGenerator(direct): class HTTPRequestHandler(SimpleHTTPRequestHandler, object): - directory = direct def __init__(self, request, client_address, server): + self.direct = direct super(HTTPRequestHandler, self).__init__(request, client_address, server) def translate_path(self, path): - return os.path.join(self.directory, path[1:]) + return os.path.join(self.direct, path[1:]) return HTTPRequestHandler - + class Server(threading.Thread): def __init__(self, directory, port=8080): super(Server, self).__init__() HTTPServer.allow_reuse_address = True server_address = ('127.0.0.1', port) self.httpd = HTTPServer(server_address, HTTPRequestHandlerGenerator(directory)) - + def run(self): self.httpd.serve_forever()