gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[gnurl] 171/222: smbserver: fix Python 3 compatibility


From: gnunet
Subject: [gnurl] 171/222: smbserver: fix Python 3 compatibility
Date: Thu, 07 Nov 2019 00:11:07 +0100

This is an automated email from the git hooks/post-receive script.

ng0 pushed a commit to branch master
in repository gnurl.

commit ee638377328527126ffbe71d1165e12c66830124
Author: Marcel Raad <address@hidden>
AuthorDate: Sun Oct 13 21:35:56 2019 +0200

    smbserver: fix Python 3 compatibility
    
    Python 2's `ConfigParser` module is spelled `configparser` in Python 3.
    
    Closes https://github.com/curl/curl/pull/4484
---
 tests/smbserver.py | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/tests/smbserver.py b/tests/smbserver.py
index 474e0612b..4fcd34f2b 100755
--- a/tests/smbserver.py
+++ b/tests/smbserver.py
@@ -24,11 +24,14 @@
 from __future__ import (absolute_import, division, print_function)
 # unicode_literals)
 import argparse
-import ConfigParser
 import os
 import sys
 import logging
 import tempfile
+try: # Python 3
+    import configparser
+except ImportError: # Python 2
+    import ConfigParser as configparser
 
 # Import our curl test data helper
 import curl_test_data
@@ -58,7 +61,7 @@ def smbserver(options):
             f.write("{0}".format(pid))
 
     # Here we write a mini config for the server
-    smb_config = ConfigParser.ConfigParser()
+    smb_config = configparser.ConfigParser()
     smb_config.add_section("global")
     smb_config.set("global", "server_name", "SERVICE")
     smb_config.set("global", "server_os", "UNIX")

-- 
To stop receiving notification emails like this one, please contact
address@hidden.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]