Skip to content

Commit 90ef41b

Browse files
committed
Fix failing 2.7 test due to deprecated pathlib
1 parent 2f84164 commit 90ef41b

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

Diff for: packages/python/plotly/plotly/io/_kaleido.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,16 @@
11
from __future__ import absolute_import
22
from six import string_types
33
import os
4+
import sys
45

56

67
import json
78
import plotly
89
from plotly.io._utils import validate_coerce_fig_to_dict
910

10-
try:
11+
if sys.version_info >= (3, 4):
1112
from pathlib import Path, PurePath
12-
except ImportError:
13+
else:
1314
# For Python < 3.4 use pathlib2
1415
from pathlib2 import Path, PurePath
1516

Diff for: packages/python/plotly/plotly/tests/test_optional/test_kaleido/test_kaleido.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
from contextlib import contextmanager
55
from io import BytesIO
66

7-
try:
7+
if sys.version_info >= (3, 4):
88
from pathlib import Path
9-
except ImportError:
9+
else:
1010
# For Python < 3.4 use pathlib2
1111
from pathlib2 import Path
1212

0 commit comments

Comments
 (0)