Package: renpy / 7.3.5+dfsg-1

02_traceback.patch Patch series | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
From: Debian Games Team <pkg-games-devel@lists.alioth.debian.org>
Date: Tue, 12 Jan 2016 18:15:44 +0100
Subject: _traceback

===================================================================
---
 renpy/error.py | 16 +++++++++++++++-
 1 file changed, 15 insertions(+), 1 deletion(-)

diff --git a/renpy/error.py b/renpy/error.py
index 760a7fa..608fd46 100644
--- a/renpy/error.py
+++ b/renpy/error.py
@@ -224,10 +224,24 @@ def report_exception(e, editor=True):
     simple = simple.getvalue()
     full = full.getvalue()
 
+    try:
+        if not os.path.isdir(os.path.expanduser("~/.renpy")):
+            os.makedirs(os.path.expanduser("~/.renpy"))
+    except:
+        pass
+
     # Inside of the file, which may not be openable.
     try:
+        tbdir = renpy.config.savedir
+        if tbdir[-1] == '/':
+           tbdir = tbdir[:-1]
+        tbdir = os.path.dirname(tbdir) + "/"
+        try:
+            os.makedirs(tbdir)
+        except:
+            pass
 
-        f, traceback_fn = open_error_file("traceback.txt", "w")
+        f, traceback_fn = open_error_file(tbdir + "traceback.txt", "w")
 
         f.write(codecs.BOM_UTF8)