summaryrefslogtreecommitdiff
path: root/coverage/sqldata.py
diff options
context:
space:
mode:
authorNed Batchelder <ned@nedbatchelder.com>2021-05-01 13:02:31 -0400
committerNed Batchelder <ned@nedbatchelder.com>2021-05-01 13:30:39 -0400
commit9df434550a499c16e9fd26cfb9627837bfdc02a5 (patch)
tree5619ea3c3bec05d04363a66ced9c7ebffcefb1df /coverage/sqldata.py
parent3fe17c1f2244c07cf9d0f9e3609392c2ad441db1 (diff)
downloadpython-coveragepy-git-9df434550a499c16e9fd26cfb9627837bfdc02a5.tar.gz
refactor: remove code explicitly choosing between py2 and py3
Diffstat (limited to 'coverage/sqldata.py')
-rw-r--r--coverage/sqldata.py17
1 files changed, 1 insertions, 16 deletions
diff --git a/coverage/sqldata.py b/coverage/sqldata.py
index 205c56c0..62df6508 100644
--- a/coverage/sqldata.py
+++ b/coverage/sqldata.py
@@ -16,7 +16,6 @@ import sqlite3
import sys
import zlib
-from coverage import env
from coverage.backward import get_thread_id, iitems, to_bytes, to_string
from coverage.debug import NoDebugging, SimpleReprMixin, clipped_repr
from coverage.files import PathAliases
@@ -1002,20 +1001,6 @@ class SqliteDb(SimpleReprMixin):
if self.con is not None:
return
- # SQLite on Windows on py2 won't open a file if the filename argument
- # has non-ascii characters in it. Opening a relative file name avoids
- # a problem if the current directory has non-ascii.
- filename = self.filename
- if env.WINDOWS and env.PY2:
- try:
- filename = os.path.relpath(self.filename)
- except ValueError:
- # ValueError can be raised under Windows when os.getcwd() returns a
- # folder from a different drive than the drive of self.filename in
- # which case we keep the original value of self.filename unchanged,
- # hoping that we won't face the non-ascii directory problem.
- pass
-
# It can happen that Python switches threads while the tracer writes
# data. The second thread will also try to write to the data,
# effectively causing a nested context. However, given the idempotent
@@ -1023,7 +1008,7 @@ class SqliteDb(SimpleReprMixin):
# is not a problem.
if self.debug:
self.debug.write("Connecting to {!r}".format(self.filename))
- self.con = sqlite3.connect(filename, check_same_thread=False)
+ self.con = sqlite3.connect(self.filename, check_same_thread=False)
self.con.create_function('REGEXP', 2, _regexp)
# This pragma makes writing faster. It disables rollbacks, but we never need them.