From 167e9b954ae74bec46c00e5ec621c5f86af437a8 Mon Sep 17 00:00:00 2001 From: Jon Dufresne Date: Fri, 26 Oct 2018 06:23:11 -0700 Subject: [PATCH] Remove use of unnecessary compat shim, six.binary_type The type `bytes` is available on all supported Python versions. On Python 2.7, it is an alias of str, same as six.binary_type. Makes the code slightly more forward compatible. --- changelog/4248.trivial.txt | 1 + src/_pytest/pathlib.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) create mode 100644 changelog/4248.trivial.txt diff --git a/changelog/4248.trivial.txt b/changelog/4248.trivial.txt new file mode 100644 index 000000000..ecd9399a7 --- /dev/null +++ b/changelog/4248.trivial.txt @@ -0,0 +1 @@ +Remove use of unnecessary compat shim, six.binary_type diff --git a/src/_pytest/pathlib.py b/src/_pytest/pathlib.py index b3519c682..7d7516b22 100644 --- a/src/_pytest/pathlib.py +++ b/src/_pytest/pathlib.py @@ -159,7 +159,7 @@ def create_cleanup_lock(p): else: pid = os.getpid() spid = str(pid) - if not isinstance(spid, six.binary_type): + if not isinstance(spid, bytes): spid = spid.encode("ascii") os.write(fd, spid) os.close(fd)