Skip to content

Commit 729642e

Browse files
author
Slava Katiukha
committed
Fix Python 3.x compatibility issue and update dependencies
1 parent 5c290f6 commit 729642e

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

3rdparty/mkdocs-versioned/mkdocs_versioned/cli.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,13 @@ def build_command(config_file, strict, site_dir, branches, default_branch, lates
135135
formatedCSVersions = {}
136136
virtuozzoVersions = []
137137

138+
try:
139+
# Python 2.x
140+
unicode # Attempt to access undefined name 'unicode' in Python 3.x will raise a NameError
141+
except NameError:
142+
# Python 3.x
143+
unicode = str # Define 'unicode' as an alias for 'str' in Python 3.x
144+
138145
for version in versions:
139146
formatedCSVersions[unicode(version)] = versions[version]
140147

Pipfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ name = "pypi"
77
markdown = {editable = true, path = "3rdparty/markdown"}
88
pymdown-extensions = {editable = true, path = "3rdparty/pymdown-extensions"}
99
mkdocs = {editable = true, path = "3rdparty/mkdocs"}
10-
mkdocs-versioned = {editable = true, path = "3rdparty/mkdocs-versioned"}
11-
markdown-tabs = {editable = true, path = "plugins/markdown-tabs"}
1210
GitPython = "==3.0.6"
11+
mkdocs_versioned = {editable = true, path = "3rdparty/mkdocs-versioned"}
12+
markdown-tabs = {editable = true, path = "plugins/markdown-tabs"}
1313

1414
[dev-packages]
1515

0 commit comments

Comments
 (0)