mirror of
https://github.com/ejwa/gitinspector.git
synced 2024-09-28 18:31:30 +02: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
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 print_function
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
#Small fix for Python 3
|
|
||||||
try:
|
|
||||||
unicode
|
|
||||||
except NameError:
|
|
||||||
def unicode(string):
|
|
||||||
return str(string)
|
|
||||||
|
|
||||||
import localization
|
import localization
|
||||||
localization.init()
|
localization.init()
|
||||||
|
|
||||||
|
try:
|
||||||
|
from compatibility import unicode
|
||||||
|
except:
|
||||||
|
pass
|
||||||
|
|
||||||
import blame
|
import blame
|
||||||
import changes
|
import changes
|
||||||
import config
|
import config
|
||||||
|
Loading…
Reference in New Issue
Block a user