Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
D
dorie
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
2
Issues
2
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Simon Lüdke
dorie
Commits
0fee176e
Commit
0fee176e
authored
Nov 02, 2017
by
Lukas Riedel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed bug where parfield creation would crash in Python3 due to raw_input call
parent
3173699f
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
1 deletion
+6
-1
python/parfield/dorie/parfield/parameter_file.py
python/parfield/dorie/parfield/parameter_file.py
+6
-1
No files found.
python/parfield/dorie/parfield/parameter_file.py
View file @
0fee176e
...
...
@@ -2,6 +2,11 @@ import os
import
h5py
import
numpy
as
np
try
:
# Python 2.x compatibility
input
=
raw_input
except
NameError
:
pass
def
read_parameter_file
(
in_path
):
data_dict
=
{}
with
h5py
.
File
(
in_path
,
'r'
)
as
f
:
...
...
@@ -32,7 +37,7 @@ def write_parameter_file(group,data_dict,out_path,attrs=None,overwrite=False):
"""
if
os
.
path
.
isfile
(
out_path
)
and
not
overwrite
:
ow
=
raw_
input
(
"The output file {} already exists. Overwrite? [y/N] "
.
format
(
out_path
))
ow
=
input
(
"The output file {} already exists. Overwrite? [y/N] "
.
format
(
out_path
))
if
not
ow
.
lower
()
in
[
"y"
,
"yes"
]:
raise
RuntimeError
(
"Aborting"
)
...
...
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