Skip to content

Commit

Permalink
Fix xmlrpc implementation
Browse files Browse the repository at this point in the history
Signed-off-by: Dan Ryan <dan@danryan.co>

fix xmlrpc implementation

Signed-off-by: Dan Ryan <dan@danryan.co>
  • Loading branch information
techalchemy committed Jul 6, 2019
1 parent 1630da8 commit e559b00
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions tests/pytest-pypi/pytest_pypi/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,10 @@
from zipfile import is_zipfile

import requests
from six.moves import xmlrpc_client

from flask import Flask, redirect, abort, render_template, send_file, jsonify

if sys.version_info[:2] >= (3, 0):
from xmlrpc.client import ServerProxy
else:
from xmlrpclib import ServerProxy

app = Flask(__name__)
session = requests.Session()
Expand All @@ -27,12 +24,12 @@

@contextlib.contextmanager
def xml_pypi_server(server):
session = requests.Session()
client = ServerProxy(server, session)
transport = xmlrpc_client.Transport()
client = xmlrpc_client.ServerProxy(server, transport)
try:
yield client
finally:
session.close()
transport.close()


def get_pypi_package_names():
Expand Down

0 comments on commit e559b00

Please sign in to comment.