Changeset: 62af77bfa869 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=62af77bfa869
Modified Files:
testing/Mconvert.py.in
testing/Mtest.py.in
testing/Mz.py.in
testing/process.py
Branch: mtest
Log Message:
We do not support Python 2.
diffs (123 lines):
diff --git a/testing/Mconvert.py.in b/testing/Mconvert.py.in
--- a/testing/Mconvert.py.in
+++ b/testing/Mconvert.py.in
@@ -494,24 +494,14 @@ def startswithpath(str,pre) :
return os.path.normcase(str[:len(pre)]) == os.path.normcase(pre)
### startswithpath(str,pre) #
-if sys.version_info[0] == 2:
- import urllib
- path = urllib.url2pathname
- def url(str) :
- url = urllib.pathname2url(str)
- # on Windows, C:\tmp\foo becomes ///C:/tmp/foo, turn into /C:/tmp/foo
- if url.startswith('///'):
- url = url[2:]
- return url
-elif sys.version_info[0] == 3:
- import urllib.request
- path = urllib.request.url2pathname
- def url(str) :
- url = urllib.request.pathname2url(str)
- # on Windows, C:\tmp\foo becomes ///C:/tmp/foo, turn into /C:/tmp/foo
- if url.startswith('///'):
- url = url[2:]
- return url
+import urllib.request
+path = urllib.request.url2pathname
+def url(str) :
+ url = urllib.request.pathname2url(str)
+ # on Windows, C:\tmp\foo becomes ///C:/tmp/foo, turn into /C:/tmp/foo
+ if url.startswith('///'):
+ url = url[2:]
+ return url
def openutf8(file, mode='r'):
return open(file, mode, encoding='utf-8', errors='replace')
diff --git a/testing/Mtest.py.in b/testing/Mtest.py.in
--- a/testing/Mtest.py.in
+++ b/testing/Mtest.py.in
@@ -647,24 +647,14 @@ def startswithpath(str,pre) :
##def url(str) :
## return str.replace(os.sep, '/')
### url(str) #
-if sys.version_info[0] == 2:
- import urllib
- path = urllib.url2pathname
- def url(str) :
- url = urllib.pathname2url(str)
- # on Windows, C:\tmp\foo becomes ///C:/tmp/foo, turn into /C:/tmp/foo
- if url.startswith('///'):
- url = url[2:]
- return url
-elif sys.version_info[0] == 3:
- import urllib.request
- path = urllib.request.url2pathname
- def url(str) :
- url = urllib.request.pathname2url(str)
- # on Windows, C:\tmp\foo becomes ///C:/tmp/foo, turn into /C:/tmp/foo
- if url.startswith('///'):
- url = url[2:]
- return url
+import urllib.request
+path = urllib.request.url2pathname
+def url(str) :
+ url = urllib.request.pathname2url(str)
+ # on Windows, C:\tmp\foo becomes ///C:/tmp/foo, turn into /C:/tmp/foo
+ if url.startswith('///'):
+ url = url[2:]
+ return url
def openutf8(file, mode='r'):
return open(file, mode, encoding='utf-8', errors='replace')
diff --git a/testing/Mz.py.in b/testing/Mz.py.in
--- a/testing/Mz.py.in
+++ b/testing/Mz.py.in
@@ -495,24 +495,14 @@ def startswithpath(str,pre) :
return os.path.normcase(str[:len(pre)]) == os.path.normcase(pre)
### startswithpath(str,pre) #
-if sys.version_info[0] == 2:
- import urllib
- path = urllib.url2pathname
- def url(str) :
- url = urllib.pathname2url(str)
- # on Windows, C:\tmp\foo becomes ///C:/tmp/foo, turn into /C:/tmp/foo
- if url.startswith('///'):
- url = url[2:]
- return url
-elif sys.version_info[0] == 3:
- import urllib.request
- path = urllib.request.url2pathname
- def url(str) :
- url = urllib.request.pathname2url(str)
- # on Windows, C:\tmp\foo becomes ///C:/tmp/foo, turn into /C:/tmp/foo
- if url.startswith('///'):
- url = url[2:]
- return url
+import urllib.request
+path = urllib.request.url2pathname
+def url(str) :
+ url = urllib.request.pathname2url(str)
+ # on Windows, C:\tmp\foo becomes ///C:/tmp/foo, turn into /C:/tmp/foo
+ if url.startswith('///'):
+ url = url[2:]
+ return url
def openutf8(file, mode='r'):
return open(file, mode, encoding='utf-8', errors='replace')
diff --git a/testing/process.py b/testing/process.py
--- a/testing/process.py
+++ b/testing/process.py
@@ -14,10 +14,7 @@ import copy
import atexit
import threading
import signal
-if sys.version.startswith('2'):
- import Queue as queue
-else:
- import queue
+import queue
from subprocess import PIPE
try:
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list