| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 6a5eb6a commit a44f8d9
9 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -4,6 +4,7 @@ | |||
| 4 | 4 | __all__ = ["Submodule", "UpdateProgress"] | |
| 5 | 5 | ||
| 6 | 6 | import gc | |
| 7 | + from configparser import NoSectionError | ||
| 7 | 8 | from io import BytesIO | |
| 8 | 9 | import logging | |
| 9 | 10 | import os | |
@@ -16,7 +17,7 @@ | |||
| 16 | 17 | import git | |
| 17 | 18 | from git.cmd import Git | |
| 18 | 19 | from git.compat import defenc | |
| 19 | - from git.config import GitConfigParser, SectionConstraint, cp | ||
| 20 | + from git.config import GitConfigParser, SectionConstraint | ||
| 20 | 21 | from git.exc import ( | |
| 21 | 22 | BadName, | |
| 22 | 23 | InvalidGitRepositoryError, | |
@@ -172,7 +173,7 @@ def _set_cache_(self, attr: str) -> None: | |||
| 172 | 173 | # Default submodule values. | |
| 173 | 174 | try: | |
| 174 | 175 | self.path = reader.get("path") | |
| 175 | - except cp.NoSectionError as e: | ||
| 176 | + except NoSectionError as e: | ||
| 176 | 177 | if self.repo.working_tree_dir is not None: | |
| 177 | 178 | raise ValueError( | |
| 178 | 179 | "This submodule instance does not exist anymore in '%s' file" | |
@@ -1503,7 +1504,7 @@ def exists(self) -> bool: | |||
| 1503 | 1504 | if hasattr(self, attr): | |
| 1504 | 1505 | loc[attr] = getattr(self, attr) | |
| 1505 | 1506 | # END if we have the attribute cache | |
| 1506 | - except (cp.NoSectionError, ValueError): | ||
| 1507 | + except (NoSectionError, ValueError): | ||
| 1507 | 1508 | # On PY3, this can happen apparently... don't know why this doesn't | |
| 1508 | 1509 | # happen on PY2. | |
| 1509 | 1510 | pass | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -110,7 +110,7 @@ def flush_to_index(self) -> None: | |||
| 110 | 110 | # } END interface | |
| 111 | 111 | ||
| 112 | 112 | # { Overridden Methods | |
| 113 | - def write(self) -> None: # type: ignore[override] | ||
| 113 | + def write(self) -> None: | ||
| 114 | 114 | rval: None = super().write() | |
| 115 | 115 | self.flush_to_index() | |
| 116 | 116 | return rval | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -8,12 +8,13 @@ | |||
| 8 | 8 | __all__ = ["RemoteProgress", "PushInfo", "FetchInfo", "Remote"] | |
| 9 | 9 | ||
| 10 | 10 | import contextlib | |
| 11 | + from configparser import NoOptionError, NoSectionError | ||
| 11 | 12 | import logging | |
| 12 | 13 | import re | |
| 13 | 14 | ||
| 14 | 15 | from git.cmd import Git, handle_process_output | |
| 15 | 16 | from git.compat import defenc, force_text | |
| 16 | - from git.config import GitConfigParser, SectionConstraint, cp | ||
| 17 | + from git.config import GitConfigParser, SectionConstraint | ||
| 17 | 18 | from git.exc import GitCommandError | |
| 18 | 19 | from git.refs import Head, Reference, RemoteReference, SymbolicReference, TagReference | |
| 19 | 20 | from git.util import ( | |
@@ -577,7 +578,7 @@ def __getattr__(self, attr: str) -> Any: | |||
| 577 | 578 | # though a slot of the same name exists. | |
| 578 | 579 | try: | |
| 579 | 580 | return self._config_reader.get(attr) | |
| 580 | - except cp.NoOptionError: | ||
| 581 | + except NoOptionError: | ||
| 581 | 582 | return super().__getattr__(attr) | |
| 582 | 583 | # END handle exception | |
| 583 | 584 | ||
@@ -619,10 +620,10 @@ def exists(self) -> bool: | |||
| 619 | 620 | try: | |
| 620 | 621 | self.config_reader.get("url") | |
| 621 | 622 | return True | |
| 622 | - except cp.NoOptionError: | ||
| 623 | + except NoOptionError: | ||
| 623 | 624 | # We have the section at least... | |
| 624 | 625 | return True | |
| 625 | - except cp.NoSectionError: | ||
| 626 | + except NoSectionError: | ||
| 626 | 627 | return False | |
| 627 | 628 | ||
| 628 | 629 | @classmethod | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -22,8 +22,7 @@ | |||
| 22 | 22 | url = git://gitorious.org/~martin.marcher/git-python/serverhorror.git | |
| 23 | 23 | fetch = +refs/heads/*:refs/remotes/MartinMarcher/* | |
| 24 | 24 | # can handle comments - the section name is supposed to be stripped | |
| 25 | - # causes stock git-config puke | ||
| 26 | - [ gui ] | ||
| 25 | + [gui] | ||
| 27 | 26 | geometry = 1316x820+219+243 207 192 | |
| 28 | 27 | [branch "mainline_performance"] | |
| 29 | 28 | remote = mainline | |
@@ -43,4 +42,3 @@ | |||
| 43 | 42 | # inclusions should be processed immediately | |
| 44 | 43 | [sec] | |
| 45 | 44 | var1 = value1_main | |
| 46 | - | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -4,4 +4,4 @@ | |||
| 4 | 4 | [section1] | |
| 5 | 5 | option1 = value1a | |
| 6 | 6 | option1 = value1b | |
| 7 | - other_option1 = other_value1 | ||
| 7 | + other-option1 = other_value1 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -3,7 +3,5 @@ | |||
| 3 | 3 | hasbackslash = "foo\\bar" | |
| 4 | 4 | hasquote = "ab\"cd" | |
| 5 | 5 | hastrailingbackslash = "word\\" | |
| 6 | - hasunrecognized = "p\qrs" | ||
| 7 | - hasunescapedquotes = "ab"cd"e" | ||
| 8 | 6 | ordinary = "hello world" | |
| 9 | 7 | unquoted = good evening | |
| Back | FazBrowse Home | New Git URL |
0 commit comments