We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ef60adc commit 1ba3634Copy full SHA for 1ba3634
sc2reader/objects.py
@@ -50,7 +50,12 @@ class Replay(object):
50
def __init__(self, replay_file, **options):
51
#Useful references
52
self.opt = AttributeDict(**options)
53
- self.filename = replay_file.name
+
54
+ # Some file-like objects may not support filenames. Issue #21
55
+ if hasattr(replay_file, 'name'):
56
+ self.filename = replay_file.name
57
+ else:
58
+ self.filename = "Unavailable"
59
60
#header information
61
self.versions,self.frames = read_header(replay_file)
0 commit comments