Skip to content

Commit 7828217

Browse files
committed
windows packaging fixes
1 parent 436dc24 commit 7828217

3 files changed

Lines changed: 11 additions & 5 deletions

File tree

package.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
from io import open
1818

1919
# get setup.py parameters
20-
from setup import SETUP_OPTIONS, VERSION, new_command, wash
20+
from setup import SETUP_OPTIONS, VERSION, new_command, wash, NAME, AUTHOR, VERSION, COPYRIGHT
2121

2222

2323
# operating in cx_Freeze mode

pcbasic/compat/base.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,9 +80,14 @@ def split_quoted(line, split_by=u'\s', quote=u'"', strip_quotes=False):
8080
@contextlib.contextmanager
8181
def muffle(std_stream):
8282
"""Suppress stdout or stderr messages."""
83+
save = None
8384
try:
84-
# save the file descriptor for the target stream
85-
save = os.dup(std_stream.fileno())
85+
try:
86+
# save the file descriptor for the target stream
87+
save = os.dup(std_stream.fileno())
88+
except EnvironmentError:
89+
yield
90+
return
8691
# http://stackoverflow.com/questions/977840/
8792
# redirecting-fortran-called-via-f2py-output-in-python/978264#978264
8893
with open(os.devnull, 'w') as null:
@@ -96,4 +101,5 @@ def muffle(std_stream):
96101
# restore file descriptors
97102
os.dup2(save, std_stream.fileno())
98103
finally:
99-
os.close(save)
104+
if save is not None:
105+
os.close(save)

pcbasic/guard.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ def protect(self, *args, **kwargs):
4747
COMMIT = check_output(
4848
['git', 'describe', '--always'], cwd=os.path.dirname(__file__)
4949
).strip().decode('ascii', 'ignore')
50-
except CalledProcessError:
50+
except (CalledProcessError, EnvironmentError):
5151
COMMIT = u'unknown'
5252

5353

0 commit comments

Comments
 (0)