Skip to content

Commit eda6dc5

Browse files
committed
Allow using os.* constants for seeking
1 parent ac6d8e6 commit eda6dc5

File tree

3 files changed

+3
-4
lines changed

3 files changed

+3
-4
lines changed

src/core/modules/filesystem/filesystem.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -176,10 +176,10 @@ void SourceFile::Close()
176176
}
177177
}
178178

179-
void SourceFile::Seek(int pos, FileSystemSeek_t seekType)
179+
void SourceFile::Seek(int pos, int seekType)
180180
{
181181
CheckClosed();
182-
filesystem->Seek(m_handle, pos, seekType);
182+
filesystem->Seek(m_handle, pos, (FileSystemSeek_t) seekType);
183183
}
184184

185185
unsigned int SourceFile::Tell()

src/core/modules/filesystem/filesystem.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ class SourceFile
4747
PyObject* Read(int size=-1);
4848
int Write(object data);
4949
void Close();
50-
void Seek(int pos, FileSystemSeek_t seekType=FILESYSTEM_SEEK_HEAD);
50+
void Seek(int pos, int seekType=FILESYSTEM_SEEK_HEAD);
5151
unsigned int Tell();
5252
unsigned int Size();
5353
void Flush();

src/core/modules/filesystem/filesystem_wrap.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,6 @@ void export_source_file(scope _filesystem)
112112
&SourceFile::Close
113113
);
114114

115-
// TODO Allow os.* constants?
116115
_SourceFile.def(
117116
"seek",
118117
&SourceFile::Seek,

0 commit comments

Comments
 (0)