Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commite633cc0

Browse files
Harmon758Byron
authored andcommitted
Remove and replace compat.UnicodeMixin
1 parent05cf33a commite633cc0

File tree

2 files changed

+3
-17
lines changed

2 files changed

+3
-17
lines changed

‎git/compat.py

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -76,17 +76,3 @@ def __new__(cls, name, nbases, d):
7676
d['__metaclass__']=meta
7777
returnmeta(name,bases,d)
7878
returnmetaclass(meta.__name__+'Helper',None, {})
79-
80-
81-
## From https://docs.python.org/3.3/howto/pyporting.html
82-
classUnicodeMixin(object):
83-
84-
"""Mixin class to handle defining the proper __str__/__unicode__
85-
methods in Python 2 or 3."""
86-
87-
ifPY3:
88-
def__str__(self):
89-
returnself.__unicode__()
90-
else:# Python 2
91-
def__str__(self):
92-
returnself.__unicode__().encode(defenc)

‎git/exc.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
""" Module containing all exceptions thrown throughout the git package, """
77

88
fromgitdb.excimport*# NOQA @UnusedWildImport skipcq: PYL-W0401, PYL-W0614
9-
fromgit.compatimportUnicodeMixin,safe_decode,string_types
9+
fromgit.compatimportsafe_decode,string_types
1010

1111

1212
classGitError(Exception):
@@ -25,7 +25,7 @@ class NoSuchPathError(GitError, OSError):
2525
""" Thrown if a path could not be access by the system. """
2626

2727

28-
classCommandError(UnicodeMixin,GitError):
28+
classCommandError(GitError):
2929
"""Base class for exceptions thrown at every stage of `Popen()` execution.
3030
3131
:param command:
@@ -58,7 +58,7 @@ def __init__(self, command, status=None, stderr=None, stdout=None):
5858
self.stdout=stdoutandu"\n stdout: '%s'"%safe_decode(stdout)or''
5959
self.stderr=stderrandu"\n stderr: '%s'"%safe_decode(stderr)or''
6060

61-
def__unicode__(self):
61+
def__str__(self):
6262
return (self._msg+"\n cmdline: %s%s%s")% (
6363
self._cmd,self._cause,self._cmdline,self.stdout,self.stderr)
6464

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp