Skip to content

Commit e234b61

Browse files
committed
Used io.open() to support encoding param in Py 2
1 parent 463a02c commit e234b61

8 files changed

Lines changed: 16 additions & 16 deletions

File tree

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import json, os, sys
1+
import io, json, os, sys
22

3-
with open(os.path.join(os.path.dirname(__file__), 'computer-languages.json'), encoding='utf-8') as file:
3+
with io.open(os.path.join(os.path.dirname(__file__), 'computer-languages.json'), encoding='utf-8') as file:
44
computer_languages = json.load(file)
55

66
sys.modules[__name__] = computer_languages
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import json, os, sys
1+
import io, json, os, sys
22

3-
with open(os.path.join(os.path.dirname(__file__), 'data-languages.json'), encoding='utf-8') as file:
3+
with io.open(os.path.join(os.path.dirname(__file__), 'data-languages.json'), encoding='utf-8') as file:
44
data_languages = json.load(file)
55

66
sys.modules[__name__] = data_languages
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import json, os, sys
1+
import io, json, os, sys
22

3-
with open(os.path.join(os.path.dirname(__file__), 'latin-locales.json'), encoding='utf-8') as file:
3+
with io.open(os.path.join(os.path.dirname(__file__), 'latin-locales.json'), encoding='utf-8') as file:
44
latin_locales = json.load(file)
55

66
sys.modules[__name__] = latin_locales
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import json, os, sys
1+
import io, json, os, sys
22

3-
with open(os.path.join(os.path.dirname(__file__), 'markup-languages.json'), encoding='utf-8') as file:
3+
with io.open(os.path.join(os.path.dirname(__file__), 'markup-languages.json'), encoding='utf-8') as file:
44
markup_languages = json.load(file)
55

66
sys.modules[__name__] = markup_languages
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import json, os, sys
1+
import io, json, os, sys
22

3-
with open(os.path.join(os.path.dirname(__file__), 'non-latin-locales.json'), encoding='utf-8') as file:
3+
with io.open(os.path.join(os.path.dirname(__file__), 'non-latin-locales.json'), encoding='utf-8') as file:
44
non_latin_locales = json.load(file)
55

66
sys.modules[__name__] = non_latin_locales
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import json, os, sys
1+
import io, json, os, sys
22

3-
with open(os.path.join(os.path.dirname(__file__), 'programming-languages.json'), encoding='utf-8') as file:
3+
with io.open(os.path.join(os.path.dirname(__file__), 'programming-languages.json'), encoding='utf-8') as file:
44
programming_languages = json.load(file)
55

66
sys.modules[__name__] = programming_languages
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import json, os, sys
1+
import io, json, os, sys
22

3-
with open(os.path.join(os.path.dirname(__file__), 'project-markers.json'), encoding='utf-8') as file:
3+
with io.open(os.path.join(os.path.dirname(__file__), 'project-markers.json'), encoding='utf-8') as file:
44
project_markers = json.load(file)
55

66
sys.modules[__name__] = project_markers
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import json, os, sys
1+
import io, json, os, sys
22

3-
with open(os.path.join(os.path.dirname(__file__), 'prose-languages.json'), encoding='utf-8') as file:
3+
with io.open(os.path.join(os.path.dirname(__file__), 'prose-languages.json'), encoding='utf-8') as file:
44
prose_languages = json.load(file)
55

66
sys.modules[__name__] = prose_languages

0 commit comments

Comments
 (0)