Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
H
Hdlmake
Manage
Activity
Members
Labels
Plan
Issues
20
Issue boards
Milestones
Wiki
Code
Merge requests
5
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Projects
Hdlmake
Commits
0bea7cec
Commit
0bea7cec
authored
13 years ago
by
Paweł Szostek
Browse files
Options
Downloads
Patches
Plain Diff
Handle unexpected parsing errors in manfiests
parent
200ff96a
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
synthesis/configparser.py
+9
-0
9 additions, 0 deletions
synthesis/configparser.py
with
9 additions
and
0 deletions
synthesis/configparser.py
+
9
−
0
View file @
0bea7cec
...
...
@@ -218,17 +218,26 @@ class ConfigParser(object):
#This is important because in the manifests only certain group
#of variables is allowed. In arbitrary code all of them can be used.
arbitrary_options = {}
import sys
try:
exec(self.arbitrary_code, arbitrary_options)
except SyntaxError as e:
p.rawprint(str(e) +
"
\n
Invalid syntax in the arbitraty code
"
)
quit()
except:
p.rawprint(
"
Unexpted error while parsing arbitrary code
"
)
p.rawprint(str(sys.exc_info()[0])+
'
:
'
+str(sys.exc_info()[1]))
quit()
try:
exec(content, options)
except SyntaxError as e:
p.rawprint(str(e)+
"
\n
Invalid syntax in the manifest file:
"
+ self.file)
quit()
except:
p.rawprint(
"
Encountered unexpected error while parsing
"
+ self.file)
p.rawprint(str(sys.exc_info()[0]) +
'
:
'
+ str(sys.exc_info()[1]))
quit()
for opt_name, val in list(options.items()): #check delivered options
if opt_name.startswith(
'
__
'
):
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment