Skip to content

Commit

Permalink
only open files as utf-8 with Python 3.0+
Browse files Browse the repository at this point in the history
  • Loading branch information
wting committed Nov 24, 2012
1 parent 024d550 commit 2c75c36
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions bin/autojump
Expand Up @@ -24,11 +24,11 @@ from __future__ import division, print_function
import sys
import os
try:
import argparse
import argparse
except ImportError:
sys.path.append(os.path.dirname(os.path.realpath(__file__)))
import autojump_argparse as argparse
sys.path.pop()
sys.path.append(os.path.dirname(os.path.realpath(__file__)))
import autojump_argparse as argparse
sys.path.pop()
from operator import itemgetter
import re
import shutil
Expand Down Expand Up @@ -114,7 +114,7 @@ class Database:
"""
if os.path.exists(self.filename):
try:
if sys.version > (2, 6):
if sys.version_info >= (3, 0):
with open(self.filename, 'r', encoding = 'utf-8') as f:
for line in f.readlines():
weight, path = line[:-1].split("\t", 1)
Expand Down

0 comments on commit 2c75c36

Please sign in to comment.