| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent ebbef7b commit ea9ac33
4 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -121,14 +121,14 @@ def parsekeywordpairs(signature): | |||
| 121 | 121 | parendepth = 0 | |
| 122 | 122 | for token, value in tokens: | |
| 123 | 123 | if preamble: | |
| 124 | - if token is Token.Punctuation and value == u"(": | ||
| 124 | + if token is Token.Punctuation and value == "(": | ||
| 125 | 125 | preamble = False | |
| 126 | 126 | continue | |
| 127 | 127 | ||
| 128 | 128 | if token is Token.Punctuation: | |
| 129 | - if value in [u"(", u"{", u"["]: | ||
| 129 | + if value in ["(", "{", "["]: | ||
| 130 | 130 | parendepth += 1 | |
| 131 | - elif value in [u")", u"}", u"]"]: | ||
| 131 | + elif value in [")", "}", "]"]: | ||
| 132 | 132 | parendepth -= 1 | |
| 133 | 133 | elif value == ":" and parendepth == -1: | |
| 134 | 134 | # End of signature reached | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -470,7 +470,7 @@ def ps2(self): | |||
| 470 | 470 | try: | |
| 471 | 471 | return sys.ps2 | |
| 472 | 472 | except AttributeError: | |
| 473 | - return u"... " | ||
| 473 | + return "... " | ||
| 474 | 474 | ||
| 475 | 475 | def startup(self): | |
| 476 | 476 | """ | |
@@ -659,11 +659,11 @@ def get_source_of_current_name(self): | |||
| 659 | 659 | obj = self.get_object(line) | |
| 660 | 660 | return inspection.get_source_unicode(obj) | |
| 661 | 661 | except (AttributeError, NameError) as e: | |
| 662 | - msg = _(u"Cannot get source: %s") % (e,) | ||
| 662 | + msg = _("Cannot get source: %s") % (e,) | ||
| 663 | 663 | except IOError as e: | |
| 664 | - msg = u"%s" % (e,) | ||
| 664 | + msg = f"{e}" | ||
| 665 | 665 | except TypeError as e: | |
| 666 | - if "built-in" in u"%s" % (e,): | ||
| 666 | + if "built-in" in f"{e}": | ||
| 667 | 667 | msg = _("Cannot access source of %r") % (obj,) | |
| 668 | 668 | else: | |
| 669 | 669 | msg = _("No source code found for %s") % (self.current_line,) | |
@@ -946,7 +946,7 @@ def insert_into_history(self, s): | |||
| 946 | 946 | s, pythonhist, getpreferredencoding() | |
| 947 | 947 | ) | |
| 948 | 948 | except RuntimeError as e: | |
| 949 | - self.interact.notify(u"%s" % (e,)) | ||
| 949 | + self.interact.notify(f"{e}") | ||
| 950 | 950 | ||
| 951 | 951 | def prompt_undo(self): | |
| 952 | 952 | """Returns how many lines to undo, 0 means don't undo""" | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -46,7 +46,7 @@ def ctrlc(): | |||
| 46 | 46 | ||
| 47 | 47 | class TestFakeOutput(unittest.TestCase): | |
| 48 | 48 | def assert_unicode(self, s): | |
| 49 | - self.assertIsInstance(s, type(u"")) | ||
| 49 | + self.assertIsInstance(s, type("")) | ||
| 50 | 50 | ||
| 51 | 51 | def test_bytes(self): | |
| 52 | 52 | out = FakeOutput(mock.Mock(), self.assert_unicode, None) | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -7,12 +7,12 @@ | |||
| 7 | 7 | from bpython.test.fodder import encoding_utf8 | |
| 8 | 8 | ||
| 9 | 9 | ||
| 10 | - foo_ascii_only = u'''def foo(): | ||
| 10 | + foo_ascii_only = '''def foo(): | ||
| 11 | 11 | """Test""" | |
| 12 | 12 | pass | |
| 13 | 13 | ''' | |
| 14 | 14 | ||
| 15 | - foo_non_ascii = u'''def foo(): | ||
| 15 | + foo_non_ascii = '''def foo(): | ||
| 16 | 16 | """Test äöü""" | |
| 17 | 17 | pass | |
| 18 | 18 | ''' | |
| Back | FazBrowse Home | New Git URL |
0 commit comments