← Back to team overview

curtin-dev team mailing list archive

Re: [Merge] ~dbungert/curtin:py35-fixes into curtin:release/23.1

 


Diff comments:

> diff --git a/tests/integration/webserv.py b/tests/integration/webserv.py
> index f4ce4e4..de30e04 100644
> --- a/tests/integration/webserv.py
> +++ b/tests/integration/webserv.py
> @@ -12,7 +14,17 @@ class ThreadedTCPServer(socketserver.ThreadingMixIn, socketserver.TCPServer):
>  
>  class ImageHTTPRequestHandler(SimpleHTTPRequestHandler):
>      def __init__(self, *args, **kwargs):
> -        super().__init__(*args, directory=IMAGE_DIR, **kwargs)
> +        try:
> +            super().__init__(*args, directory=IMAGE_DIR, **kwargs)
> +        except TypeError:
> +            # SimpleHTTPRequestHandler in python < 3.7 doesn't take a directory
> +            # arg, fake it.
> +            curdir = os.getcwd()
> +            os.chdir(IMAGE_DIR)

Nevermind, reading is hard!

> +            try:
> +                super().__init__(*args, **kwargs)
> +            finally:
> +                os.chdir(curdir)
>  
>  
>  class ImageServer:


-- 
https://code.launchpad.net/~dbungert/curtin/+git/curtin/+merge/443616
Your team curtin developers is subscribed to branch curtin:release/23.1.



References