Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
H
Hdlmake
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
15
Issues
15
List
Board
Labels
Milestones
Merge Requests
4
Merge Requests
4
Wiki
Wiki
image/svg+xml
Discourse
Discourse
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Projects
Hdlmake
Commits
d52106b6
Commit
d52106b6
authored
Apr 29, 2016
by
Will
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix circular dependency checking.
Use negative number, put check in the right place.
parent
ce365fc5
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
+4
-4
dep_file.py
hdlmake/dep_file.py
+4
-4
No files found.
hdlmake/dep_file.py
View file @
d52106b6
...
...
@@ -197,12 +197,12 @@ class DepFile(File):
if
self
.
dep_level
==
None
:
if
len
(
self
.
depends_on
)
==
0
:
self
.
dep_level
=
0
elif
self
.
dep_level
>=
1000000
:
raise
Exception
(
"Probably run into a circular reference of file dependencies."
)
else
:
# set
stupidly large value so
can detect if the recusion below brings us back to
# set
dep_level to a negative value so we
can detect if the recusion below brings us back to
# this file in a circular reference, that would otherwise result in an infinite loop.
self
.
dep_level
=
1000000
self
.
dep_level
=
-
1
# recurse, to find the largest number of levels below.
self
.
dep_level
=
1
+
max
([
dep
.
get_dep_level
()
for
dep
in
self
.
depends_on
]);
elif
self
.
dep_level
<
0
:
raise
Exception
(
"Probably run into a circular reference of file dependencies."
)
return
self
.
dep_level
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment