mirror of
https://gitlab.com/scemama/irpf90.git
synced 2024-12-21 11:53:32 +01:00
Fixed UnicodeError
This commit is contained in:
parent
199d035364
commit
4cde057ea2
21
src/init.py
21
src/init.py
@ -1,7 +1,7 @@
|
|||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
# IRPF90 is a Fortran90 preprocessor written in Python for programming using
|
# IRPF90 is a Fortran90 preprocessor written in Python for programming using
|
||||||
# the Implicit Reference to Parameters (IRP) method.
|
# the Implicit Reference to Parameters (IRP) method.
|
||||||
# Copyright (C) 2009 Anthony SCEMAMA
|
# Copyright (C) 2009 Anthony SCEMAMA
|
||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or modify
|
# This program is free software; you can redistribute it and/or modify
|
||||||
# it under the terms of the GNU General Public License as published by
|
# it under the terms of the GNU General Public License as published by
|
||||||
@ -20,8 +20,8 @@
|
|||||||
# Anthony Scemama
|
# Anthony Scemama
|
||||||
# LCPQ - IRSAMC - CNRS
|
# LCPQ - IRSAMC - CNRS
|
||||||
# Universite Paul Sabatier
|
# Universite Paul Sabatier
|
||||||
# 118, route de Narbonne
|
# 118, route de Narbonne
|
||||||
# 31062 Toulouse Cedex 4
|
# 31062 Toulouse Cedex 4
|
||||||
# scemama@irsamc.ups-tlse.fr
|
# scemama@irsamc.ups-tlse.fr
|
||||||
|
|
||||||
|
|
||||||
@ -61,7 +61,7 @@ def init():
|
|||||||
|
|
||||||
# Create makefile
|
# Create makefile
|
||||||
makefile.create()
|
makefile.create()
|
||||||
|
|
||||||
# Copy current files in the irpdir
|
# Copy current files in the irpdir
|
||||||
for dir in ['./']+command_line.include_dir:
|
for dir in ['./']+command_line.include_dir:
|
||||||
try:
|
try:
|
||||||
@ -78,12 +78,15 @@ def init():
|
|||||||
if command_line.do_warnings:
|
if command_line.do_warnings:
|
||||||
print("Warning : Unable to read file %s."%(filename))
|
print("Warning : Unable to read file %s."%(filename))
|
||||||
else:
|
else:
|
||||||
buffer = file.read()
|
try:
|
||||||
file.close()
|
buffer = file.read()
|
||||||
if not util.same_file(irpf90_t.irpdir+filename,buffer):
|
|
||||||
file = open(irpf90_t.irpdir+filename,"w")
|
|
||||||
file.write(buffer)
|
|
||||||
file.close()
|
file.close()
|
||||||
|
if not util.same_file(irpf90_t.irpdir+filename,buffer):
|
||||||
|
file = open(irpf90_t.irpdir+filename,"w")
|
||||||
|
file.write(buffer)
|
||||||
|
file.close()
|
||||||
|
except UnicodeError:
|
||||||
|
pass
|
||||||
|
|
||||||
initialized = True
|
initialized = True
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user