| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 05cf33a commit e633cc0
2 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -76,17 +76,3 @@ def __new__(cls, name, nbases, d): | |||
| 76 | 76 | d['__metaclass__'] = meta | |
| 77 | 77 | return meta(name, bases, d) | |
| 78 | 78 | return metaclass(meta.__name__ + 'Helper', None, {}) | |
| 79 | - | ||
| 80 | - | ||
| 81 | - ## From https://docs.python.org/3.3/howto/pyporting.html | ||
| 82 | - class UnicodeMixin(object): | ||
| 83 | - | ||
| 84 | - """Mixin class to handle defining the proper __str__/__unicode__ | ||
| 85 | - methods in Python 2 or 3.""" | ||
| 86 | - | ||
| 87 | - if PY3: | ||
| 88 | - def __str__(self): | ||
| 89 | - return self.__unicode__() | ||
| 90 | - else: # Python 2 | ||
| 91 | - def __str__(self): | ||
| 92 | - return self.__unicode__().encode(defenc) | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -6,7 +6,7 @@ | |||
| 6 | 6 | """ Module containing all exceptions thrown throughout the git package, """ | |
| 7 | 7 | ||
| 8 | 8 | from gitdb.exc import * # NOQA @UnusedWildImport skipcq: PYL-W0401, PYL-W0614 | |
| 9 | - from git.compat import UnicodeMixin, safe_decode, string_types | ||
| 9 | + from git.compat import safe_decode, string_types | ||
| 10 | 10 | ||
| 11 | 11 | ||
| 12 | 12 | class GitError(Exception): | |
@@ -25,7 +25,7 @@ class NoSuchPathError(GitError, OSError): | |||
| 25 | 25 | """ Thrown if a path could not be access by the system. """ | |
| 26 | 26 | ||
| 27 | 27 | ||
| 28 | - class CommandError(UnicodeMixin, GitError): | ||
| 28 | + class CommandError(GitError): | ||
| 29 | 29 | """Base class for exceptions thrown at every stage of `Popen()` execution. | |
| 30 | 30 | ||
| 31 | 31 | :param command: | |
@@ -58,7 +58,7 @@ def __init__(self, command, status=None, stderr=None, stdout=None): | |||
| 58 | 58 | self.stdout = stdout and u"\n stdout: '%s'" % safe_decode(stdout) or '' | |
| 59 | 59 | self.stderr = stderr and u"\n stderr: '%s'" % safe_decode(stderr) or '' | |
| 60 | 60 | ||
| 61 | - def __unicode__(self): | ||
| 61 | + def __str__(self): | ||
| 62 | 62 | return (self._msg + "\n cmdline: %s%s%s") % ( | |
| 63 | 63 | self._cmd, self._cause, self._cmdline, self.stdout, self.stderr) | |
| 64 | 64 | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments