mirror of
https://github.com/ejwa/gitinspector.git
synced 2024-12-22 13:42:14 +01:00
Moved unicode function declaration to a compatibility module.
This is used (as the name suggests) for compatibility between Python 2 and Python 3.
This commit is contained in:
parent
8edd72a609
commit
f4b10ce15f
2 changed files with 32 additions and 7 deletions
27
gitinspector/compatibility.py
Normal file
27
gitinspector/compatibility.py
Normal file
|
@ -0,0 +1,27 @@
|
|||
#!/usr/bin/python
|
||||
# coding: utf-8
|
||||
#
|
||||
# Copyright © 2013 Ejwa Software. All rights reserved.
|
||||
#
|
||||
# This file is part of gitinspector.
|
||||
#
|
||||
# gitinspector is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# gitinspector is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with gitinspector. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
import sys
|
||||
|
||||
try:
|
||||
unicode
|
||||
except NameError:
|
||||
def unicode(string):
|
||||
return str(string)
|
|
@ -21,16 +21,14 @@
|
|||
from __future__ import print_function
|
||||
from __future__ import unicode_literals
|
||||
|
||||
#Small fix for Python 3
|
||||
try:
|
||||
unicode
|
||||
except NameError:
|
||||
def unicode(string):
|
||||
return str(string)
|
||||
|
||||
import localization
|
||||
localization.init()
|
||||
|
||||
try:
|
||||
from compatibility import unicode
|
||||
except:
|
||||
pass
|
||||
|
||||
import blame
|
||||
import changes
|
||||
import config
|
||||
|
|
Loading…
Reference in a new issue