Fix syntax.

This commit is contained in:
Jelmer Vernooij 2021-03-25 23:05:52 +00:00
parent f08359c73c
commit 445c2c19d2
No known key found for this signature in database
GPG key ID: 579C160D4C9E23E8
2 changed files with 3 additions and 3 deletions

View file

@ -1146,7 +1146,7 @@ class Cargo(BuildSystem):
def _parse_go_mod(f):
line = f.readline()
while f:
while line:
parts = line.strip().split(' ')
if not parts:
continue
@ -1187,7 +1187,7 @@ class Golang(BuildSystem):
def get_declared_dependencies(self, session, fixers=None):
go_mod_path = os.path.join(self.path, 'go.mod')
if not os.path.exists(go_mod_path):
if os.path.exists(go_mod_path):
with open(go_mod_path, 'r') as f:
for parts in _parse_go_mod(f):
if parts[0] == 'go':

View file

@ -284,7 +284,7 @@ class GoRequirement(Requirement):
version: Optional[str]
def __init__(self, version: Optional[str] = None):
super(GoPackageRequirement, self).__init__("go")
super(GoRequirement, self).__init__("go")
self.version = version